Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCannotGetLatestEpochStartMetaBlock = errors.New("cannot fetch the latest epoch start meta block from the network: timeout")
ErrCannotGetLatestEpochStartMetaBlock signals that the latest epoch start meta block cannot be fetched from the network
var ErrComponentClosing = errors.New("cannot fetch the latest epoch start meta block from the network: context closing")
ErrComponentClosing signals that the latest epoch start meta block cannot be fetched from network because the component is closing
var ErrInvalidRoundTimeInMilliseconds = errors.New("invalid round time in milliseconds value")
ErrInvalidRoundTimeInMilliseconds signals that the provided RoundTimeInMilliseconds value is incorrect
var ErrInvalidRoundsPerEpoch = errors.New("invalid rounds per epoch value")
ErrInvalidRoundsPerEpoch signals that the provided RoundsPerEpoch value is incorrect
var ErrInvalidStartTime = errors.New("invalid start time value")
ErrInvalidStartTime signals that the provided start time is incorrect
var ErrNilEpochStartMetaBlockInterceptor = errors.New("nil epoch start meta block interceptor")
ErrNilEpochStartMetaBlockInterceptor signals that a nil epoch start meta block interceptor has been provided
var ErrNilMessenger = errors.New("nil messenger")
ErrNilMessenger signals that a nil messenger has been provided
var ErrNilRequestHandler = errors.New("nil request handler")
ErrNilRequestHandler signals that a nil request handler has been provided
Functions ¶
func NewArithmeticEpochProvider ¶
func NewArithmeticEpochProvider(arg ArgArithmeticEpochProvider) (*arithmeticEpochProvider, error)
NewArithmeticEpochProvider returns a new arithmetic epoch provider able to mathematically compute the current network epoch based on the last block saved, considering the block's timestamp and epoch in respect with the current time
Types ¶
type ArgArithmeticEpochProvider ¶
type ArgArithmeticEpochProvider struct { RoundsPerEpoch uint32 RoundTimeInMilliseconds uint64 StartTime int64 }
ArgArithmeticEpochProvider is the argument structure for the arithmetic epoch provider