Documentation ¶
Index ¶
- func IsInvalidExtensionError(err error) bool
- func IsNoValidChildBlockError(err error) bool
- func IsOutdatedExtensionError(err error) bool
- func NewInvalidExtensionError(msg string) error
- func NewInvalidExtensionErrorf(msg string, args ...interface{}) error
- func NewNoValidChildBlockError(msg string) error
- func NewNoValidChildBlockErrorf(msg string, args ...interface{}) error
- func NewOutdatedExtensionError(msg string) error
- func NewOutdatedExtensionErrorf(msg string, args ...interface{}) error
- func TraverseBackward(headers storage.Headers, startBlockID flow.Identifier, visitor onVisitBlock, ...) error
- func TraverseForward(headers storage.Headers, forkHead flow.Identifier, visitor onVisitBlock, ...) error
- type InvalidExtensionError
- type NoValidChildBlockError
- type OutdatedExtensionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInvalidExtensionError ¶
IsInvalidExtensionError returns whether the given error is an InvalidExtensionError error
func NewNoValidChildBlockErrorf ¶ added in v0.15.0
func TraverseBackward ¶ added in v0.15.1
func TraverseBackward(headers storage.Headers, startBlockID flow.Identifier, visitor onVisitBlock, shouldVisitParent shouldVisitParent) error
TraverseBackward traverses a chain segment beginning with the start block (inclusive) Blocks are traversed in reverse height order, meaning the end block must be an ancestor of the start block. The callback is called for each block in this segment. Return value of callback is used to decide if it should continue or not.
func TraverseForward ¶ added in v0.15.1
func TraverseForward(headers storage.Headers, forkHead flow.Identifier, visitor onVisitBlock, shouldVisitParent shouldVisitParent, ) error
TraverseForward traverses a chain segment in forward order. The algorithm starts at the `forkHead` and walks the chain backwards towards the genesis block. The descend continues as long as `shouldVisitParent` returns true. Starting with the first block where `shouldVisitParent` returned false, the visited blocks are fed into `visitor` in a forward order (order of increasing height). The last block that is fed into `visitor` is `forkHead`.
Types ¶
type InvalidExtensionError ¶
type InvalidExtensionError struct {
// contains filtered or unexported fields
}
InvalidExtensionError is an error for invalid extension of the state
func (InvalidExtensionError) Error ¶
func (e InvalidExtensionError) Error() string
func (InvalidExtensionError) Unwrap ¶ added in v0.14.0
func (e InvalidExtensionError) Unwrap() error
type NoValidChildBlockError ¶
type NoValidChildBlockError struct {
// contains filtered or unexported fields
}
NoValidChildBlockError is a sentinel error when the case where a certain block has no valid child.
func (NoValidChildBlockError) Error ¶
func (e NoValidChildBlockError) Error() string
func (NoValidChildBlockError) Unwrap ¶ added in v0.14.0
func (e NoValidChildBlockError) Unwrap() error
type OutdatedExtensionError ¶
type OutdatedExtensionError struct {
// contains filtered or unexported fields
}
OutdatedExtensionError is an error for the extension of the state being outdated. Being outdated doesn't mean it's invalid or not. Knowing whether an outdated extension is an invalid extension or not would take more state queries.
func (OutdatedExtensionError) Error ¶
func (e OutdatedExtensionError) Error() string
func (OutdatedExtensionError) Unwrap ¶ added in v0.14.0
func (e OutdatedExtensionError) Unwrap() error