Documentation ¶
Index ¶
- type BatchedVM
- type StateSummary
- type StateSyncableVM
- func (vm *StateSyncableVM) GetLastStateSummary(ctx context.Context) (block.StateSummary, error)
- func (vm *StateSyncableVM) GetOngoingSyncStateSummary(ctx context.Context) (block.StateSummary, error)
- func (vm *StateSyncableVM) GetStateSummary(ctx context.Context, summaryHeight uint64) (block.StateSummary, error)
- func (vm *StateSyncableVM) ParseStateSummary(ctx context.Context, summaryBytes []byte) (block.StateSummary, error)
- func (vm *StateSyncableVM) StateSyncEnabled(ctx context.Context) (bool, error)
- type VM
- func (vm *VM) BuildBlock(ctx context.Context) (snowman.Block, error)
- func (vm *VM) Default(cant bool)
- func (vm *VM) GetBlock(ctx context.Context, id ids.ID) (snowman.Block, error)
- func (vm *VM) GetBlockIDAtHeight(ctx context.Context, height uint64) (ids.ID, error)
- func (vm *VM) LastAccepted(ctx context.Context) (ids.ID, error)
- func (vm *VM) ParseBlock(ctx context.Context, b []byte) (snowman.Block, error)
- func (vm *VM) SetPreference(ctx context.Context, id ids.ID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchedVM ¶
type BatchedVM struct { T *testing.T CantGetAncestors bool CantBatchParseBlock bool GetAncestorsF func( ctx context.Context, blkID ids.ID, maxBlocksNum int, maxBlocksSize int, maxBlocksRetrivalTime time.Duration, ) ([][]byte, error) BatchedParseBlockF func( ctx context.Context, blks [][]byte, ) ([]snowman.Block, error) }
BatchedVM is a BatchedVM that is useful for testing.
func (*BatchedVM) BatchedParseBlock ¶
type StateSummary ¶
type StateSummary struct { IDV ids.ID HeightV uint64 BytesV []byte T *testing.T CantAccept bool AcceptF func(context.Context) (block.StateSyncMode, error) }
func (*StateSummary) Accept ¶
func (s *StateSummary) Accept(ctx context.Context) (block.StateSyncMode, error)
func (*StateSummary) Bytes ¶
func (s *StateSummary) Bytes() []byte
func (*StateSummary) Height ¶
func (s *StateSummary) Height() uint64
func (*StateSummary) ID ¶
func (s *StateSummary) ID() ids.ID
type StateSyncableVM ¶
type StateSyncableVM struct { T *testing.T CantStateSyncEnabled, CantStateSyncGetOngoingSummary, CantGetLastStateSummary, CantParseStateSummary, CantGetStateSummary bool StateSyncEnabledF func(context.Context) (bool, error) GetOngoingSyncStateSummaryF func(context.Context) (block.StateSummary, error) GetLastStateSummaryF func(context.Context) (block.StateSummary, error) ParseStateSummaryF func(ctx context.Context, summaryBytes []byte) (block.StateSummary, error) GetStateSummaryF func(ctx context.Context, summaryHeight uint64) (block.StateSummary, error) }
func (*StateSyncableVM) GetLastStateSummary ¶
func (vm *StateSyncableVM) GetLastStateSummary(ctx context.Context) (block.StateSummary, error)
func (*StateSyncableVM) GetOngoingSyncStateSummary ¶
func (vm *StateSyncableVM) GetOngoingSyncStateSummary(ctx context.Context) (block.StateSummary, error)
func (*StateSyncableVM) GetStateSummary ¶
func (vm *StateSyncableVM) GetStateSummary(ctx context.Context, summaryHeight uint64) (block.StateSummary, error)
func (*StateSyncableVM) ParseStateSummary ¶
func (vm *StateSyncableVM) ParseStateSummary(ctx context.Context, summaryBytes []byte) (block.StateSummary, error)
func (*StateSyncableVM) StateSyncEnabled ¶
func (vm *StateSyncableVM) StateSyncEnabled(ctx context.Context) (bool, error)
type VM ¶
type VM struct { enginetest.VM CantBuildBlock, CantParseBlock, CantGetBlock, CantSetPreference, CantLastAccepted, CantGetBlockIDAtHeight bool BuildBlockF func(context.Context) (snowman.Block, error) ParseBlockF func(context.Context, []byte) (snowman.Block, error) GetBlockF func(context.Context, ids.ID) (snowman.Block, error) SetPreferenceF func(context.Context, ids.ID) error LastAcceptedF func(context.Context) (ids.ID, error) GetBlockIDAtHeightF func(ctx context.Context, height uint64) (ids.ID, error) }
VM is a ChainVM that is useful for testing.
func (*VM) GetBlockIDAtHeight ¶
func (*VM) ParseBlock ¶
Click to show internal directories.
Click to hide internal directories.