handler

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidVrfProve = errors.New("invalid vrf prove")
	ErrStorageNonce    = errors.New("storage previous nonce failed")

	NonceStorageKey = []byte("nonceStorageKey")
)

Functions

This section is empty.

Types

type VrfHandler

type VrfHandler struct {
	// contains filtered or unexported fields
}

func GetVrfHandlerInstance

func GetVrfHandlerInstance() *VrfHandler

func NewVrfHandler

func NewVrfHandler(genesisNonce []byte) *VrfHandler

func (*VrfHandler) GenerateNonce

func (vh *VrfHandler) GenerateNonce(currentBlockNumber *big.Int, parentHash common.Hash) ([]byte, error)

func (*VrfHandler) Load

func (vh *VrfHandler) Load(hash common.Hash) ([][]byte, error)

func (*VrfHandler) SetPrivateKey

func (vh *VrfHandler) SetPrivateKey(privateKey *ecdsa.PrivateKey)

func (*VrfHandler) Storage

func (vh *VrfHandler) Storage(blockNumber *big.Int, parentHash common.Hash, blockHash common.Hash, nonce []byte) error

func (*VrfHandler) VerifyVrf

func (vh *VrfHandler) VerifyVrf(pk *ecdsa.PublicKey, currentBlockNumber *big.Int, parentBlockHash common.Hash,
	blockHash common.Hash, proof []byte) error

Jump to

Keyboard shortcuts

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