random

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockRandomness

func BlockRandomness(header *types.Header, state vm.StateDB, blockNumber uint64) (common.Hash, error)

func ComputeCommitment

func ComputeCommitment(header *types.Header, state vm.StateDB, randomness common.Hash) (common.Hash, error)

ComputeCommitment calulcates the commitment for a given randomness.

func GetLastCommitment

func GetLastCommitment(validator common.Address, header *types.Header, state vm.StateDB) (common.Hash, error)

GetLastCommitment returns up the last commitment in the smart contract

func IsRunning

func IsRunning() bool

func Random

func Random(header *types.Header, state vm.StateDB) (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(randomness, newCommitment common.Hash, proposer common.Address, header *types.Header, state vm.StateDB) 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