utils

package
v0.0.0-...-91d38f8 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: GPL-3.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSealLength = errors.New("seal is expected to be multiplication of 65")
)

Functions

func GetCheckpointNumber

func GetCheckpointNumber(epochDuration uint64, blockNumber uint64) uint64

GetCheckpointNumber returns check-point block where header contains valset of current epoch

func GetSignatureAddress

func GetSignatureAddress(data []byte, sig []byte) (common.Address, error)

GetSignatureAddress gets the signer address from the signature

func GetValSetAddresses

func GetValSetAddresses(h *types.Header) ([]common.Address, error)

GetValSetAddresses returns the address of validators from the extra-data field.

func PrepareCommittedSeal

func PrepareCommittedSeal(hash common.Hash) []byte

PrepareCommittedSeal returns a committed seal for the given hash

func SigHash

func SigHash(header *types.Header) (hash common.Hash)

sigHash returns the hash signing. It is the hash of the entire header apart from the 65 byte signature contained at the end of the extra data.

func WriteCommittedSeals

func WriteCommittedSeals(h *types.Header, committedSeals [][]byte) error

WriteCommittedSeals writes the extra-data field of a block header with given committed seals.

func WriteSeal

func WriteSeal(h *types.Header, seal []byte) error

WriteSeal writes the extra-data field of the given header with the given seals. suggest to rename to writeSeal.

func WriteValSet

func WriteValSet(h *types.Header, validators []common.Address) error

WriteValSet writes the extra-data field of the given header with the given val-sets address.

Types

This section is empty.

Jump to

Keyboard shortcuts

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