Versions in this module Expand all Collapse all v1 v1.8.4 Feb 22, 2022 v1.8.3 Feb 22, 2022 Changes in this version + var ErrHeightIndexedVMNotImplemented = errors.New("vm does not implement HeightIndexedChainVM interface") + var ErrIndexIncomplete = errors.New("query failed because height index is incomplete") + var ErrRemoteVMNotImplemented = errors.New("vm does not implement RemoteVM interface") + func BatchedParseBlock(vm Parser, blks [][]byte) ([]snowman.Block, error) + func GetAncestors(vm Getter, blkID ids.ID, maxBlocksNum int, maxBlocksSize int, ...) ([][]byte, error) + type BatchedChainVM interface + BatchedParseBlock func(blks [][]byte) ([]snowman.Block, error) + GetAncestors func(blkID ids.ID, maxBlocksNum int, maxBlocksSize int, ...) ([][]byte, error) + type ChainVM interface + BuildBlock func() (snowman.Block, error) + LastAccepted func() (ids.ID, error) + SetPreference func(ids.ID) error + type Getter interface + GetBlock func(ids.ID) (snowman.Block, error) + type HeightIndexedChainVM interface + GetBlockIDAtHeight func(height uint64) (ids.ID, error) + VerifyHeightIndex func() error + type Parser interface + ParseBlock func([]byte) (snowman.Block, error) + type TestBatchedVM struct + BatchedParseBlockF func(blks [][]byte) ([]snowman.Block, error) + CantBatchParseBlock bool + CantGetAncestors bool + GetAncestorsF func(blkID ids.ID, maxBlocksNum int, maxBlocksSize int, ...) ([][]byte, error) + T *testing.T + func (vm *TestBatchedVM) BatchedParseBlock(blks [][]byte) ([]snowman.Block, error) + func (vm *TestBatchedVM) Default(cant bool) + func (vm *TestBatchedVM) GetAncestors(blkID ids.ID, maxBlocksNum int, maxBlocksSize int, ...) ([][]byte, error) + type TestHeightIndexedVM struct + CantGetBlockIDAtHeight bool + CantVerifyHeightIndex bool + GetBlockIDAtHeightF func(height uint64) (ids.ID, error) + T *testing.T + VerifyHeightIndexF func() error + func (vm *TestHeightIndexedVM) GetBlockIDAtHeight(height uint64) (ids.ID, error) + func (vm *TestHeightIndexedVM) VerifyHeightIndex() error + type TestVM struct + BuildBlockF func() (snowman.Block, error) + CantBuildBlock bool + CantGetBlock bool + CantLastAccepted bool + CantParseBlock bool + CantSetPreference bool + GetBlockF func(ids.ID) (snowman.Block, error) + LastAcceptedF func() (ids.ID, error) + ParseBlockF func([]byte) (snowman.Block, error) + SetPreferenceF func(ids.ID) error + func (vm *TestVM) BuildBlock() (snowman.Block, error) + func (vm *TestVM) Default(cant bool) + func (vm *TestVM) GetBlock(id ids.ID) (snowman.Block, error) + func (vm *TestVM) LastAccepted() (ids.ID, error) + func (vm *TestVM) ParseBlock(b []byte) (snowman.Block, error) + func (vm *TestVM) SetPreference(id ids.ID) error