Versions in this module Expand all Collapse all v1 v1.9.0 Oct 3, 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") + var ErrStateSyncableVMNotImplemented = errors.New("vm does not implement StateSyncableVM 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 StateSummary interface + Accept func() (bool, error) + Bytes func() []byte + Height func() uint64 + ID func() ids.ID + type StateSyncableVM interface + GetLastStateSummary func() (StateSummary, error) + GetOngoingSyncStateSummary func() (StateSummary, error) + GetStateSummary func(summaryHeight uint64) (StateSummary, error) + ParseStateSummary func(summaryBytes []byte) (StateSummary, error) + StateSyncEnabled func() (bool, 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 TestStateSummary struct + AcceptF func() (bool, error) + BytesV []byte + CantAccept bool + HeightV uint64 + IDV ids.ID + T *testing.T + func (s *TestStateSummary) Accept() (bool, error) + func (s *TestStateSummary) Bytes() []byte + func (s *TestStateSummary) Height() uint64 + func (s *TestStateSummary) ID() ids.ID + type TestStateSyncableVM struct + CantGetLastStateSummary bool + CantGetStateSummary bool + CantParseStateSummary bool + CantStateSyncEnabled bool + CantStateSyncGetOngoingSummary bool + GetLastStateSummaryF func() (StateSummary, error) + GetOngoingSyncStateSummaryF func() (StateSummary, error) + GetStateSummaryF func(uint64) (StateSummary, error) + ParseStateSummaryF func(summaryBytes []byte) (StateSummary, error) + StateSyncEnabledF func() (bool, error) + T *testing.T + func (vm *TestStateSyncableVM) GetLastStateSummary() (StateSummary, error) + func (vm *TestStateSyncableVM) GetOngoingSyncStateSummary() (StateSummary, error) + func (vm *TestStateSyncableVM) GetStateSummary(key uint64) (StateSummary, error) + func (vm *TestStateSyncableVM) ParseStateSummary(summaryBytes []byte) (StateSummary, error) + func (vm *TestStateSyncableVM) StateSyncEnabled() (bool, 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