Documentation
¶
Index ¶
- type BootstrapTracker
- type Bootstrapper
- type Engine
- func (e *Engine) Accepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (e *Engine) AcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (e *Engine) AcceptedStateSummary(ctx context.Context, validatorID ids.NodeID, requestID uint32, ...) error
- func (e *Engine) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
- func (e *Engine) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (e *Engine) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (e *Engine) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (e *Engine) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (e *Engine) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, ...) error
- func (e *Engine) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
- func (e *Engine) Default(cant bool)
- func (e *Engine) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (e *Engine) Get(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (e *Engine) GetAccepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (e *Engine) GetAcceptedFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (e *Engine) GetAcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (e *Engine) GetAcceptedFrontierFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (e *Engine) GetAcceptedStateSummary(ctx context.Context, validatorID ids.NodeID, requestID uint32, ...) error
- func (e *Engine) GetAcceptedStateSummaryFailed(ctx context.Context, validatorID ids.NodeID, requestID uint32) error
- func (e *Engine) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
- func (e *Engine) GetAncestorsFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (e *Engine) GetFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (e *Engine) GetStateSummaryFrontier(ctx context.Context, validatorID ids.NodeID, requestID uint32) error
- func (e *Engine) GetStateSummaryFrontierFailed(ctx context.Context, validatorID ids.NodeID, requestID uint32) error
- func (e *Engine) Gossip(ctx context.Context) error
- func (e *Engine) HealthCheck(ctx context.Context) (interface{}, error)
- func (e *Engine) Notify(ctx context.Context, msg core.Message) error
- func (e *Engine) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID, ...) error
- func (e *Engine) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte, ...) error
- func (e *Engine) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte) error
- func (e *Engine) QueryFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (e *Engine) Shutdown(ctx context.Context) error
- func (e *Engine) Start(ctx context.Context, startReqID uint32) error
- func (e *Engine) StateSummaryFrontier(ctx context.Context, validatorID ids.NodeID, requestID uint32, summary []byte) error
- type Sender
- func (s *Sender) Default(cant bool)
- func (s *Sender) SendAccepted(ctx context.Context, validatorID ids.NodeID, requestID uint32, ...)
- func (s *Sender) SendAcceptedFrontier(ctx context.Context, validatorID ids.NodeID, requestID uint32, ...)
- func (s *Sender) SendAcceptedStateSummary(ctx context.Context, validatorID ids.NodeID, requestID uint32, ...)
- func (s *Sender) SendAncestors(ctx context.Context, vdr ids.NodeID, requestID uint32, containers [][]byte)
- func (s *Sender) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, code int32, ...) error
- func (s *Sender) SendAppGossip(ctx context.Context, config core.SendConfig, appGossipBytes []byte) error
- func (s *Sender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...) error
- func (s *Sender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (s *Sender) SendChits(ctx context.Context, vdr ids.NodeID, requestID uint32, preferredID ids.ID, ...)
- func (s *Sender) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, ...) error
- func (s *Sender) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error
- func (s *Sender) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte) error
- func (s *Sender) SendGet(ctx context.Context, vdr ids.NodeID, requestID uint32, containerID ids.ID)
- func (s *Sender) SendGetAccepted(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...)
- func (s *Sender) SendGetAcceptedFrontier(ctx context.Context, validatorIDs set.Set[ids.NodeID], requestID uint32)
- func (s *Sender) SendGetAcceptedStateSummary(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...)
- func (s *Sender) SendGetAncestors(ctx context.Context, validatorID ids.NodeID, requestID uint32, ...)
- func (s *Sender) SendGetStateSummaryFrontier(ctx context.Context, validatorIDs set.Set[ids.NodeID], requestID uint32)
- func (s *Sender) SendPullQuery(ctx context.Context, vdrs set.Set[ids.NodeID], requestID uint32, ...)
- func (s *Sender) SendPushQuery(ctx context.Context, vdrs set.Set[ids.NodeID], requestID uint32, ...)
- func (s *Sender) SendPut(ctx context.Context, vdr ids.NodeID, requestID uint32, container []byte)
- func (s *Sender) SendStateSummaryFrontier(ctx context.Context, validatorID ids.NodeID, requestID uint32, summary []byte)
- type SenderStub
- func (f SenderStub) SendAppError(_ context.Context, _ ids.NodeID, _ uint32, errorCode int32, ...) error
- func (f SenderStub) SendAppGossip(_ context.Context, _ core.SendConfig, bytes []byte) error
- func (f SenderStub) SendAppRequest(_ context.Context, _ set.Set[ids.NodeID], _ uint32, bytes []byte) error
- func (f SenderStub) SendAppResponse(_ context.Context, _ ids.NodeID, _ uint32, bytes []byte) error
- func (f SenderStub) SendCrossChainAppError(_ context.Context, _ ids.ID, _ uint32, _ int32, _ string) error
- func (f SenderStub) SendCrossChainAppRequest(_ context.Context, _ ids.ID, _ uint32, _ []byte) error
- func (f SenderStub) SendCrossChainAppResponse(_ context.Context, _ ids.ID, _ uint32, _ []byte) error
- type Timer
- type VM
- func (vm *VM) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (vm *VM) Connected(ctx context.Context, id ids.NodeID, nodeVersion *version.Application) error
- func (vm *VM) CreateHandlers(ctx context.Context) (map[string]http.Handler, error)
- func (vm *VM) Default(cant bool)
- func (vm *VM) Disconnected(ctx context.Context, id ids.NodeID) error
- func (vm *VM) HealthCheck(ctx context.Context) (interface{}, error)
- func (vm *VM) Initialize(ctx context.Context, chainCtx *consensus.Context, db database.Database, ...) error
- func (vm *VM) NewHTTPHandler(ctx context.Context) (http.Handler, error)
- func (vm *VM) SetState(ctx context.Context, state consensus.State) error
- func (vm *VM) Shutdown(ctx context.Context) error
- func (vm *VM) Version(ctx context.Context) (string, error)
- func (vm *VM) WaitForEvent(ctx context.Context) (core.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootstrapTracker ¶ added in v0.15.6
type BootstrapTracker struct {
T *testing.T
CantIsBootstrapped, CantBootstrapped, CantOnBootstrapCompleted bool
IsBootstrappedF func() bool
BootstrappedF func(ids.ID)
OnBootstrapCompletedF func() chan struct{}
}
BootstrapTracker is a test subnet
func (*BootstrapTracker) AllBootstrapped ¶ added in v0.15.6
func (s *BootstrapTracker) AllBootstrapped() <-chan struct{}
func (*BootstrapTracker) Bootstrapped ¶ added in v0.15.6
func (s *BootstrapTracker) Bootstrapped(chainID ids.ID)
Bootstrapped calls BootstrappedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*BootstrapTracker) Default ¶ added in v0.15.6
func (s *BootstrapTracker) Default(cant bool)
Default set the default callable value to [cant]
func (*BootstrapTracker) IsBootstrapped ¶ added in v0.15.6
func (s *BootstrapTracker) IsBootstrapped() bool
IsBootstrapped calls IsBootstrappedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail. Defaults to returning false.
type Bootstrapper ¶ added in v0.15.6
func (*Bootstrapper) Clear ¶ added in v0.15.6
func (b *Bootstrapper) Clear(ctx context.Context) error
func (*Bootstrapper) Default ¶ added in v0.15.6
func (b *Bootstrapper) Default(cant bool)
type Engine ¶ added in v0.15.6
type Engine struct {
T *testing.T
CantStart,
CantIsBootstrapped,
CantTimeout,
CantGossip,
CantHalt,
CantShutdown,
CantContext,
CantNotify,
CantGetStateSummaryFrontier,
CantGetStateSummaryFrontierFailed,
CantStateSummaryFrontier,
CantGetAcceptedStateSummary,
CantGetAcceptedStateSummaryFailed,
CantAcceptedStateSummary,
CantGetAcceptedFrontier,
CantGetAcceptedFrontierFailed,
CantAcceptedFrontier,
CantGetAccepted,
CantGetAcceptedFailed,
CantAccepted,
CantGet,
CantGetAncestors,
CantGetFailed,
CantGetAncestorsFailed,
CantPut,
CantAncestors,
CantPushQuery,
CantPullQuery,
CantQueryFailed,
CantChits,
CantConnected,
CantDisconnected,
CantHealth,
CantAppRequest,
CantAppResponse,
CantAppGossip,
CantAppRequestFailed,
CantGetVM bool
StartF func(ctx context.Context, startReqID uint32) error
IsBootstrappedF func() bool
ContextF func() *consensus.Context
HaltF func(context.Context)
TimeoutF, GossipF, ShutdownF func(context.Context) error
NotifyF func(context.Context, core.Message) error
GetF, GetAncestorsF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
PullQueryF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID, requestedHeight uint64) error
PutF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte) error
PushQueryF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte, requestedHeight uint64) error
AncestorsF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
AcceptedFrontierF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
GetAcceptedF, AcceptedF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredIDs set.Set[ids.ID]) error
ChitsF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, preferredIDAtHeight ids.ID, acceptedID ids.ID, acceptedHeight uint64) error
GetStateSummaryFrontierF, GetStateSummaryFrontierFailedF, GetAcceptedStateSummaryFailedF,
GetAcceptedFrontierF, GetFailedF, GetAncestorsFailedF,
QueryFailedF, GetAcceptedFrontierFailedF, GetAcceptedFailedF func(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
AppRequestFailedF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, appErr *core.AppError) error
StateSummaryFrontierF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, summary []byte) error
GetAcceptedStateSummaryF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, keys set.Set[uint64]) error
AcceptedStateSummaryF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, summaryIDs set.Set[ids.ID]) error
ConnectedF func(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
DisconnectedF func(ctx context.Context, nodeID ids.NodeID) error
HealthF func(context.Context) (interface{}, error)
GetVMF func() core.VM
AppRequestF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, msg []byte) error
AppResponseF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
AppGossipF func(ctx context.Context, nodeID ids.NodeID, msg []byte) error
}
Engine is a test engine
func (*Engine) AcceptedFrontier ¶ added in v0.15.6
func (*Engine) AcceptedStateSummary ¶ added in v0.15.6
func (*Engine) AppRequest ¶ added in v0.15.6
func (*Engine) AppRequestFailed ¶ added in v0.15.6
func (*Engine) AppResponse ¶ added in v0.15.6
func (*Engine) Disconnected ¶ added in v0.15.6
func (*Engine) GetAccepted ¶ added in v0.15.6
func (*Engine) GetAcceptedFailed ¶ added in v0.15.6
func (*Engine) GetAcceptedFrontier ¶ added in v0.15.6
func (*Engine) GetAcceptedFrontierFailed ¶ added in v0.15.6
func (*Engine) GetAcceptedStateSummary ¶ added in v0.15.6
func (*Engine) GetAcceptedStateSummaryFailed ¶ added in v0.15.6
func (*Engine) GetAncestors ¶ added in v0.15.6
func (*Engine) GetAncestorsFailed ¶ added in v0.15.6
func (*Engine) GetStateSummaryFrontier ¶ added in v0.15.6
func (*Engine) GetStateSummaryFrontierFailed ¶ added in v0.15.6
func (*Engine) HealthCheck ¶ added in v0.15.6
func (*Engine) QueryFailed ¶ added in v0.15.6
type Sender ¶ added in v0.15.6
type Sender struct {
T *testing.T
CantSendGetStateSummaryFrontier, CantSendStateSummaryFrontier,
CantSendGetAcceptedStateSummary, CantSendAcceptedStateSummary,
CantSendGetAcceptedFrontier, CantSendAcceptedFrontier,
CantSendGetAccepted, CantSendAccepted,
CantSendGet, CantSendGetAncestors, CantSendPut, CantSendAncestors,
CantSendPullQuery, CantSendPushQuery, CantSendChits,
CantSendAppRequest, CantSendAppResponse, CantSendAppError,
CantSendAppGossip, CantSendCrossChainAppRequest, CantSendCrossChainAppResponse,
CantSendCrossChainAppError bool
SendGetStateSummaryFrontierF func(context.Context, set.Set[ids.NodeID], uint32)
SendStateSummaryFrontierF func(context.Context, ids.NodeID, uint32, []byte)
SendGetAcceptedStateSummaryF func(context.Context, set.Set[ids.NodeID], uint32, []uint64)
SendAcceptedStateSummaryF func(context.Context, ids.NodeID, uint32, []ids.ID)
SendGetAcceptedFrontierF func(context.Context, set.Set[ids.NodeID], uint32)
SendAcceptedFrontierF func(context.Context, ids.NodeID, uint32, ids.ID)
SendGetAcceptedF func(context.Context, set.Set[ids.NodeID], uint32, []ids.ID)
SendAcceptedF func(context.Context, ids.NodeID, uint32, []ids.ID)
SendGetF func(context.Context, ids.NodeID, uint32, ids.ID)
SendGetAncestorsF func(context.Context, ids.NodeID, uint32, ids.ID)
SendPutF func(context.Context, ids.NodeID, uint32, []byte)
SendAncestorsF func(context.Context, ids.NodeID, uint32, [][]byte)
SendPushQueryF func(context.Context, set.Set[ids.NodeID], uint32, []byte, uint64)
SendPullQueryF func(context.Context, set.Set[ids.NodeID], uint32, ids.ID, uint64)
SendChitsF func(context.Context, ids.NodeID, uint32, ids.ID, ids.ID, ids.ID, uint64)
SendAppRequestF func(context.Context, set.Set[ids.NodeID], uint32, []byte) error
SendAppResponseF func(context.Context, ids.NodeID, uint32, []byte) error
SendAppErrorF func(context.Context, ids.NodeID, uint32, int32, string) error
SendAppGossipF func(context.Context, core.SendConfig, []byte) error
SendCrossChainAppRequestF func(context.Context, ids.ID, uint32, []byte)
SendCrossChainAppResponseF func(context.Context, ids.ID, uint32, []byte) error
SendCrossChainAppErrorF func(context.Context, ids.ID, uint32, int32, string) error
}
Sender is a test sender
func (*Sender) SendAccepted ¶ added in v0.15.6
func (s *Sender) SendAccepted(ctx context.Context, validatorID ids.NodeID, requestID uint32, containerIDs []ids.ID)
SendAccepted calls SendAcceptedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendAcceptedFrontier ¶ added in v0.15.6
func (s *Sender) SendAcceptedFrontier(ctx context.Context, validatorID ids.NodeID, requestID uint32, containerID ids.ID)
SendAcceptedFrontier calls SendAcceptedFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendAcceptedStateSummary ¶ added in v0.15.6
func (s *Sender) SendAcceptedStateSummary(ctx context.Context, validatorID ids.NodeID, requestID uint32, summaryIDs []ids.ID)
SendAcceptedStateSummary calls SendAcceptedStateSummaryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendAncestors ¶ added in v0.15.6
func (s *Sender) SendAncestors(ctx context.Context, vdr ids.NodeID, requestID uint32, containers [][]byte)
SendAncestors calls SendAncestorsF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendAppError ¶ added in v0.15.6
func (s *Sender) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, code int32, message string) error
SendAppError calls SendAppErrorF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendAppGossip ¶ added in v0.15.6
func (s *Sender) SendAppGossip( ctx context.Context, config core.SendConfig, appGossipBytes []byte, ) error
SendAppGossip calls SendAppGossipF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendAppRequest ¶ added in v0.15.6
func (s *Sender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, appRequestBytes []byte) error
SendAppRequest calls SendAppRequestF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendAppResponse ¶ added in v0.15.6
func (s *Sender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, appResponseBytes []byte) error
SendAppResponse calls SendAppResponseF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendChits ¶ added in v0.15.6
func (s *Sender) SendChits(ctx context.Context, vdr ids.NodeID, requestID uint32, preferredID ids.ID, preferredIDAtHeight ids.ID, acceptedID ids.ID, acceptedHeight uint64)
SendChits calls SendChitsF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendCrossChainAppError ¶ added in v1.1.11
func (s *Sender) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, errorMessage string) error
SendCrossChainAppError calls SendCrossChainAppErrorF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendCrossChainAppRequest ¶ added in v1.1.11
func (s *Sender) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error
SendCrossChainAppRequest calls SendCrossChainAppRequestF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendCrossChainAppResponse ¶ added in v1.1.11
func (s *Sender) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte) error
SendCrossChainAppResponse calls SendCrossChainAppResponseF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendGet ¶ added in v0.15.6
SendGet calls SendGetF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendGetAccepted ¶ added in v0.15.6
func (s *Sender) SendGetAccepted(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, containerIDs []ids.ID)
SendGetAccepted calls SendGetAcceptedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendGetAcceptedFrontier ¶ added in v0.15.6
func (s *Sender) SendGetAcceptedFrontier(ctx context.Context, validatorIDs set.Set[ids.NodeID], requestID uint32)
SendGetAcceptedFrontier calls SendGetAcceptedFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendGetAcceptedStateSummary ¶ added in v0.15.6
func (s *Sender) SendGetAcceptedStateSummary(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, heights []uint64)
SendGetAcceptedStateSummary calls SendGetAcceptedStateSummaryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendGetAncestors ¶ added in v0.15.6
func (s *Sender) SendGetAncestors(ctx context.Context, validatorID ids.NodeID, requestID uint32, containerID ids.ID)
SendGetAncestors calls SendGetAncestorsF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendGetStateSummaryFrontier ¶ added in v0.15.6
func (s *Sender) SendGetStateSummaryFrontier(ctx context.Context, validatorIDs set.Set[ids.NodeID], requestID uint32)
SendGetStateSummaryFrontier calls SendGetStateSummaryFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendPullQuery ¶ added in v0.15.6
func (s *Sender) SendPullQuery(ctx context.Context, vdrs set.Set[ids.NodeID], requestID uint32, containerID ids.ID, requestedHeight uint64)
SendPullQuery calls SendPullQueryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendPushQuery ¶ added in v0.15.6
func (s *Sender) SendPushQuery(ctx context.Context, vdrs set.Set[ids.NodeID], requestID uint32, container []byte, requestedHeight uint64)
SendPushQuery calls SendPushQueryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendPut ¶ added in v0.15.6
SendPut calls SendPutF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
func (*Sender) SendStateSummaryFrontier ¶ added in v0.15.6
func (s *Sender) SendStateSummaryFrontier(ctx context.Context, validatorID ids.NodeID, requestID uint32, summary []byte)
SendStateSummaryFrontier calls SendStateSummaryFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.
type SenderStub ¶
type SenderStub struct {
SentAppRequest, SentAppResponse,
SentAppGossip chan []byte
SentAppError chan *core.AppError
}
SenderStub is a stub sender that returns values received on method-specific channels.
func (SenderStub) SendAppError ¶ added in v0.15.6
func (SenderStub) SendAppGossip ¶ added in v0.15.6
func (f SenderStub) SendAppGossip(_ context.Context, _ core.SendConfig, bytes []byte) error
func (SenderStub) SendAppRequest ¶ added in v0.15.6
func (SenderStub) SendAppResponse ¶ added in v0.15.6
func (SenderStub) SendCrossChainAppError ¶ added in v1.1.11
func (SenderStub) SendCrossChainAppRequest ¶ added in v1.1.11
func (SenderStub) SendCrossChainAppResponse ¶ added in v1.1.11
type Timer ¶ added in v0.15.6
Timer is a test timer
func (*Timer) RegisterTimeout ¶ added in v0.15.6
type VM ¶ added in v0.15.6
type VM struct {
T *testing.T
CantInitialize, CantSetState,
CantShutdown, CantCreateHandlers, CantNewHTTPHandler,
CantHealthCheck, CantConnected, CantDisconnected, CantVersion,
CantAppRequest, CantAppResponse, CantAppGossip, CantAppRequestFailed bool
InitializeF func(ctx context.Context, chainCtx *consensus.Context, db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, fxs []*core.Fx, appSender core.AppSender) error
SetStateF func(ctx context.Context, state consensus.State) error
ShutdownF func(context.Context) error
CreateHandlersF func(context.Context) (map[string]http.Handler, error)
NewHTTPHandlerF func(context.Context) (http.Handler, error)
ConnectedF func(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
DisconnectedF func(ctx context.Context, nodeID ids.NodeID) error
HealthCheckF func(context.Context) (interface{}, error)
AppRequestF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, msg []byte) error
AppResponseF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
AppGossipF func(ctx context.Context, nodeID ids.NodeID, msg []byte) error
AppRequestFailedF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, appErr *core.AppError) error
VersionF func(context.Context) (string, error)
WaitForEventF core.Subscription
}
VM is a test vm