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 Sender
- func (s *Sender) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (s *Sender) SendAppGossip(ctx context.Context, sendConfig appsender.SendConfig, appGossipBytes []byte) error
- func (s *Sender) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], 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) 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
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 Sender ¶
type Sender struct {
SendAppGossipF func(ctx context.Context, sendConfig appsender.SendConfig, gossipBytes []byte) error
SendAppGossipSpecificF func(ctx context.Context, nodeIDs set.Set[ids.NodeID], gossipBytes []byte) error
SendAppRequestF func(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, requestBytes []byte) error
SendAppResponseF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, responseBytes []byte) error
SendAppErrorF func(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error
SendCrossChainAppRequestF func(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error
SendCrossChainAppResponseF func(ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte) error
SendCrossChainAppErrorF func(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, errorMessage string) error
}
Sender is a test implementation of appsender.AppSender
func (*Sender) SendAppError ¶
func (s *Sender) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error
SendAppError implements core.AppSender
func (*Sender) SendAppGossip ¶
func (s *Sender) SendAppGossip(ctx context.Context, sendConfig appsender.SendConfig, appGossipBytes []byte) error
SendAppGossip implements appsender.AppSender
func (*Sender) SendAppGossipSpecific ¶
func (s *Sender) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
SendAppGossipSpecific implements core.AppSender
func (*Sender) SendAppRequest ¶
func (s *Sender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, appRequestBytes []byte) error
SendAppRequest implements core.AppSender
func (*Sender) SendAppResponse ¶
func (s *Sender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, appResponseBytes []byte) error
SendAppResponse implements core.AppSender
func (*Sender) SendCrossChainAppError ¶
func (s *Sender) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, errorMessage string) error
SendCrossChainAppError implements core.AppSender
Click to show internal directories.
Click to hide internal directories.