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 WarpSender
- func (s *WarpSender) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, code int32, ...) error
- func (s *WarpSender) SendAppGossip(ctx context.Context, nodeIDs set.Set[ids.NodeID], msg []byte) error
- func (s *WarpSender) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], msg []byte) error
- func (s *WarpSender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, msg []byte) error
- func (s *WarpSender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
- func (s *WarpSender) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, code int32, ...) error
- func (s *WarpSender) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
- func (s *WarpSender) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []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 WarpSender ¶ added in v1.16.56
type WarpSender struct {
T *testing.T
// Function hooks - set these to customize behavior
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
// Fail flags - set to true to fail on unexpected calls
CantSendAppRequest bool
CantSendAppResponse bool
CantSendAppError bool
CantSendAppGossip bool
CantSendCrossChainAppRequest bool
CantSendCrossChainAppResponse bool
CantSendCrossChainAppError bool
}
WarpSender is a test implementation of p2p.WarpSender. Set function fields to customize behavior, or leave nil for default no-op. Set Cant* fields to true to fail on unexpected calls.
func (*WarpSender) SendAppError ¶ added in v1.22.2
func (*WarpSender) SendAppGossip ¶ added in v1.22.2
func (*WarpSender) SendAppGossipSpecific ¶ added in v1.22.2
func (*WarpSender) SendAppRequest ¶ added in v1.22.2
func (*WarpSender) SendAppResponse ¶ added in v1.22.2
func (*WarpSender) SendCrossChainAppError ¶ added in v1.22.2
func (*WarpSender) SendCrossChainAppRequest ¶ added in v1.22.2
func (*WarpSender) SendCrossChainAppResponse ¶ added in v1.22.2
Click to show internal directories.
Click to hide internal directories.