random

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2022 License: GPL-3.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockRandomness

func BlockRandomness(vmRunner vm.EVMRunner, blockNumber uint64) (common.Hash, error)

func ComputeCommitment

func ComputeCommitment(vmRunner vm.EVMRunner, randomness common.Hash) (common.Hash, error)

ComputeCommitment calulcates the commitment for a given randomness.

func GetLastCommitment

func GetLastCommitment(vmRunner vm.EVMRunner, validator common.Address) (common.Hash, error)

GetLastCommitment returns up the last commitment in the smart contract

func IsRunning

func IsRunning(vmRunner vm.EVMRunner) bool

func Random

func Random(vmRunner vm.EVMRunner) (common.Hash, error)

Random performs an internal call to the EVM to retrieve the current randomness from the official Random contract.

func RevealAndCommit

func RevealAndCommit(vmRunner vm.EVMRunner, randomness, newCommitment common.Hash, proposer common.Address) error

RevealAndCommit performs an internal call to the EVM that reveals a proposer's previously committed to randomness, and commits new randomness for a future block.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL