Documentation
¶
Index ¶
- func NewClient(t *testing.T, ctx context.Context, clientNodeID ids.NodeID, ...) *p2p.Client
- func NewClientWithPeers(t *testing.T, ctx context.Context, clientNodeID ids.NodeID, ...) *p2p.Client
- func NewSelfClient(t *testing.T, ctx context.Context, nodeID ids.NodeID, handler p2p.Handler) *p2p.Client
- type SenderTest
- func (s *SenderTest) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (s *SenderTest) SendAppGossip(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
- func (s *SenderTest) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
- func (s *SenderTest) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...) error
- func (s *SenderTest) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (s *SenderTest) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, ...) error
- func (s *SenderTest) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error
- func (s *SenderTest) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient( t *testing.T, ctx context.Context, clientNodeID ids.NodeID, clientHandler p2p.Handler, serverNodeID ids.NodeID, serverHandler p2p.Handler, ) *p2p.Client
NewClient generates a client-server pair and returns the client used to communicate with a server with the specified handler
Types ¶
type SenderTest ¶ added in v1.17.2
type SenderTest struct {
T *testing.T
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, set.Set[ids.NodeID], []byte) error
SendCrossChainAppRequestF func(context.Context, ids.ID, uint32, []byte) error
SendCrossChainAppResponseF func(context.Context, ids.ID, uint32, []byte) error
SendCrossChainAppErrorF func(context.Context, ids.ID, uint32, int32, string) error
CantSendAppRequest bool
CantSendAppResponse bool
CantSendAppError bool
CantSendAppGossip bool
CantSendCrossChainAppRequest bool
CantSendCrossChainAppResponse bool
CantSendCrossChainAppError bool
}
SenderTest is a test implementation of AppSender that implements p2p.ExtendedAppSender directly. The function callbacks take set.Set[ids.NodeID] to match the ExtendedAppSender interface. Interface compliance is verified at usage site to avoid import cycles.
func (*SenderTest) SendAppError ¶ added in v1.22.1
func (*SenderTest) SendAppGossip ¶ added in v1.22.1
func (*SenderTest) SendAppGossipSpecific ¶ added in v1.22.1
func (*SenderTest) SendAppRequest ¶ added in v1.22.1
func (*SenderTest) SendAppResponse ¶ added in v1.22.1
func (*SenderTest) SendCrossChainAppError ¶ added in v1.22.1
func (*SenderTest) SendCrossChainAppRequest ¶ added in v1.22.1
func (*SenderTest) SendCrossChainAppResponse ¶ added in v1.22.1
Click to show internal directories.
Click to hide internal directories.