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) Context() *snow.ConsensusContext
- 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) Halt(ctx context.Context)
- func (e *Engine) HealthCheck(ctx context.Context) (interface{}, error)
- func (e *Engine) Notify(ctx context.Context, msg common.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
- func (e *Engine) Timeout(ctx context.Context) 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 common.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) 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, _ common.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
- 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 *snow.Context, db database.Database, ...) error
- func (vm *VM) SetState(ctx context.Context, state snow.State) error
- func (vm *VM) Shutdown(ctx context.Context) error
- func (vm *VM) Version(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootstrapTracker ¶
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) Bootstrapped ¶
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 ¶
func (s *BootstrapTracker) Default(cant bool)
Default set the default callable value to [cant]
func (*BootstrapTracker) IsBootstrapped ¶
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.
func (*BootstrapTracker) OnBootstrapCompleted ¶
func (s *BootstrapTracker) OnBootstrapCompleted() chan struct{}
type Bootstrapper ¶
func (*Bootstrapper) Default ¶
func (b *Bootstrapper) Default(cant bool)
type Engine ¶
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() *snow.ConsensusContext HaltF func(context.Context) TimeoutF, GossipF, ShutdownF func(context.Context) error NotifyF func(context.Context, common.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) 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 *common.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() common.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 ¶
func (*Engine) AcceptedStateSummary ¶
func (*Engine) AppRequest ¶
func (*Engine) AppRequestFailed ¶
func (*Engine) AppResponse ¶
func (*Engine) Context ¶
func (e *Engine) Context() *snow.ConsensusContext
func (*Engine) Disconnected ¶
func (*Engine) GetAccepted ¶
func (*Engine) GetAcceptedFailed ¶
func (*Engine) GetAcceptedFrontier ¶
func (*Engine) GetAcceptedFrontierFailed ¶
func (*Engine) GetAcceptedStateSummary ¶
func (*Engine) GetAcceptedStateSummaryFailed ¶
func (*Engine) GetAncestors ¶
func (*Engine) GetAncestorsFailed ¶
func (*Engine) GetStateSummaryFrontier ¶
func (*Engine) GetStateSummaryFrontierFailed ¶
func (*Engine) QueryFailed ¶
func (*Engine) StateSummaryFrontier ¶
type Sender ¶
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 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) 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, common.SendConfig, []byte) error }
Sender is a test sender
func (*Sender) SendAccepted ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (s *Sender) SendAppGossip( ctx context.Context, config common.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 ¶
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 ¶
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 ¶
func (s *Sender) SendChits(ctx context.Context, vdr ids.NodeID, requestID uint32, preferredID ids.ID, preferredIDAtHeight ids.ID, acceptedID ids.ID)
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) SendGet ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 *common.AppError
}
SenderStub is a stub sender that returns values received on method-specific channels.
func (SenderStub) SendAppError ¶
func (SenderStub) SendAppGossip ¶
func (f SenderStub) SendAppGossip(_ context.Context, _ common.SendConfig, bytes []byte) error
func (SenderStub) SendAppRequest ¶
func (SenderStub) SendAppResponse ¶
type Timer ¶
Timer is a test timer
func (*Timer) RegisterTimeout ¶
type VM ¶
type VM struct { T *testing.T CantInitialize, CantSetState, CantShutdown, CantCreateHandlers, CantHealthCheck, CantConnected, CantDisconnected, CantVersion, CantAppRequest, CantAppResponse, CantAppGossip, CantAppRequestFailed bool InitializeF func(ctx context.Context, chainCtx *snow.Context, db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, msgChan chan<- common.Message, fxs []*common.Fx, appSender common.AppSender) error SetStateF func(ctx context.Context, state snow.State) error ShutdownF func(context.Context) error CreateHandlersF func(context.Context) (map[string]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 *common.AppError) error VersionF func(context.Context) (string, error) }
VM is a test vm