Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInsufficientEpoch is returned when insufficient past epochs for apr computation ErrInsufficientEpoch = errors.New("insufficient past epochs to compute apr") // ErrCouldNotRetreiveHeaderByNumber is returned when fail to retrieve header by number ErrCouldNotRetreiveHeaderByNumber = errors.New("could not retrieve header by number") // ErrZeroStakenetEpochAgo is returned when total delegation is zero for net epoch ago ErrZeroStakenetEpochAgo = errors.New("zero total delegation net epoch ago") )
Functions ¶
func ComputeForValidator ¶
func ComputeForValidator( bc Reader, block *types.Block, wrapper *staking.ValidatorWrapper, ) (*numeric.Dec, error)
ComputeForValidator ..
Types ¶
type Reader ¶
type Reader interface { GetHeaderByNumber(number uint64) *block.Header Config() *params.ChainConfig GetHeaderByHash(hash common.Hash) *block.Header // GetHeader retrieves a block header from the database by hash and number. GetHeader(hash common.Hash, number uint64) *block.Header CurrentHeader() *block.Header ReadValidatorSnapshotAtEpoch( epoch *big.Int, addr common.Address, ) (*staking.ValidatorSnapshot, error) }
Reader ..
Click to show internal directories.
Click to hide internal directories.