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
- func NewSenderTestAdapter(sender *SenderTest) p2p.ExtendedAppSender
- type SenderTest
- type SenderTestAdapter
- func (s *SenderTestAdapter) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (s *SenderTestAdapter) SendAppGossip(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
- func (s *SenderTestAdapter) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
- func (s *SenderTestAdapter) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...) error
- func (s *SenderTestAdapter) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (s *SenderTestAdapter) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, ...) error
- func (s *SenderTestAdapter) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error
- func (s *SenderTestAdapter) 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
func NewClientWithPeers ¶
func NewClientWithPeers( t *testing.T, ctx context.Context, clientNodeID ids.NodeID, clientHandler p2p.Handler, peers map[ids.NodeID]p2p.Handler, ) *p2p.Client
NewClientWithPeers generates a client to communicate to a set of peers
func NewSelfClient ¶
func NewSenderTestAdapter ¶ added in v1.17.2
func NewSenderTestAdapter(sender *SenderTest) p2p.ExtendedAppSender
Types ¶
type SenderTest ¶ added in v1.17.2
type SenderTest struct {
T *testing.T
SendAppRequestF func(context.Context, 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, []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
type SenderTestAdapter ¶ added in v1.17.2
type SenderTestAdapter struct {
*SenderTest
}
SenderTestAdapter adapts SenderTest to p2p.ExtendedAppSender
func (*SenderTestAdapter) SendAppError ¶ added in v1.17.2
func (*SenderTestAdapter) SendAppGossip ¶ added in v1.17.2
func (*SenderTestAdapter) SendAppGossipSpecific ¶ added in v1.17.2
func (*SenderTestAdapter) SendAppRequest ¶ added in v1.17.2
func (*SenderTestAdapter) SendAppResponse ¶ added in v1.17.2
func (*SenderTestAdapter) SendCrossChainAppError ¶ added in v1.17.2
func (*SenderTestAdapter) SendCrossChainAppRequest ¶ added in v1.17.2
func (*SenderTestAdapter) SendCrossChainAppResponse ¶ added in v1.17.2
Click to show internal directories.
Click to hide internal directories.