Documentation ¶
Overview ¶
Package sender is a generated GoMock package.
Index ¶
- func New(ctx *snow.ConsensusContext, msgCreator message.OutboundMsgBuilder, ...) (common.Sender, error)
- func Trace(sender common.Sender, tracer trace.Tracer) common.Sender
- type ExternalSender
- type ExternalSenderTest
- func (s *ExternalSenderTest) Default(cant bool)
- func (s *ExternalSenderTest) Gossip(msg message.OutboundMessage, subnetID ids.ID, validatorOnly bool, ...) set.Set[ids.NodeID]
- func (s *ExternalSenderTest) Send(msg message.OutboundMessage, nodeIDs set.Set[ids.NodeID], subnetID ids.ID, ...) set.Set[ids.NodeID]
- type GossipConfig
- type MockExternalSender
- func (m *MockExternalSender) EXPECT() *MockExternalSenderMockRecorder
- func (m *MockExternalSender) Gossip(arg0 message.OutboundMessage, arg1 ids.ID, arg2 bool, arg3, arg4, arg5 int) set.Set[ids.NodeID]
- func (m *MockExternalSender) Send(arg0 message.OutboundMessage, arg1 set.Set[ids.NodeID], arg2 ids.ID, arg3 bool) set.Set[ids.NodeID]
- type MockExternalSenderMockRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New( ctx *snow.ConsensusContext, msgCreator message.OutboundMsgBuilder, externalSender ExternalSender, router router.Router, timeouts timeout.Manager, gossipConfig GossipConfig, ) (common.Sender, error)
Types ¶
type ExternalSender ¶
type ExternalSender interface { // Send a message to a specific set of nodes Send( msg message.OutboundMessage, nodeIDs set.Set[ids.NodeID], subnetID ids.ID, validatorOnly bool, ) set.Set[ids.NodeID] // Send a message to a random group of nodes in a subnet. // Nodes are sampled based on their validator status. Gossip( msg message.OutboundMessage, subnetID ids.ID, validatorOnly bool, numValidatorsToSend int, numNonValidatorsToSend int, numPeersToSend int, ) set.Set[ids.NodeID] }
ExternalSender sends consensus messages to other validators Right now this is implemented in the networking package
type ExternalSenderTest ¶
type ExternalSenderTest struct { TB testing.TB CantSend, CantGossip bool SendF func(msg message.OutboundMessage, nodeIDs set.Set[ids.NodeID], subnetID ids.ID, validatorOnly bool) set.Set[ids.NodeID] GossipF func(msg message.OutboundMessage, subnetID ids.ID, validatorOnly bool, numValidatorsToSend, numNonValidatorsToSend, numPeersToSend int) set.Set[ids.NodeID] }
ExternalSenderTest is a test sender
func (*ExternalSenderTest) Default ¶
func (s *ExternalSenderTest) Default(cant bool)
Default set the default callable value to [cant]
func (*ExternalSenderTest) Gossip ¶
func (s *ExternalSenderTest) Gossip( msg message.OutboundMessage, subnetID ids.ID, validatorOnly bool, numValidatorsToSend int, numNonValidatorsToSend int, numPeersToSend int, ) set.Set[ids.NodeID]
Given a msg type, the corresponding mock function is called 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 GossipConfig ¶
type GossipConfig struct { AcceptedFrontierValidatorSize uint `json:"gossipAcceptedFrontierValidatorSize" yaml:"gossipAcceptedFrontierValidatorSize"` AcceptedFrontierNonValidatorSize uint `json:"gossipAcceptedFrontierNonValidatorSize" yaml:"gossipAcceptedFrontierNonValidatorSize"` AcceptedFrontierPeerSize uint `json:"gossipAcceptedFrontierPeerSize" yaml:"gossipAcceptedFrontierPeerSize"` OnAcceptValidatorSize uint `json:"gossipOnAcceptValidatorSize" yaml:"gossipOnAcceptValidatorSize"` OnAcceptNonValidatorSize uint `json:"gossipOnAcceptNonValidatorSize" yaml:"gossipOnAcceptNonValidatorSize"` OnAcceptPeerSize uint `json:"gossipOnAcceptPeerSize" yaml:"gossipOnAcceptPeerSize"` AppGossipValidatorSize uint `json:"appGossipValidatorSize" yaml:"appGossipValidatorSize"` AppGossipNonValidatorSize uint `json:"appGossipNonValidatorSize" yaml:"appGossipNonValidatorSize"` AppGossipPeerSize uint `json:"appGossipPeerSize" yaml:"appGossipPeerSize"` }
type MockExternalSender ¶ added in v1.8.7
type MockExternalSender struct {
// contains filtered or unexported fields
}
MockExternalSender is a mock of ExternalSender interface.
func NewMockExternalSender ¶ added in v1.8.7
func NewMockExternalSender(ctrl *gomock.Controller) *MockExternalSender
NewMockExternalSender creates a new mock instance.
func (*MockExternalSender) EXPECT ¶ added in v1.8.7
func (m *MockExternalSender) EXPECT() *MockExternalSenderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockExternalSenderMockRecorder ¶ added in v1.8.7
type MockExternalSenderMockRecorder struct {
// contains filtered or unexported fields
}
MockExternalSenderMockRecorder is the mock recorder for MockExternalSender.
func (*MockExternalSenderMockRecorder) Gossip ¶ added in v1.8.7
func (mr *MockExternalSenderMockRecorder) Gossip(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call
Gossip indicates an expected call of Gossip.
func (*MockExternalSenderMockRecorder) Send ¶ added in v1.8.7
func (mr *MockExternalSenderMockRecorder) Send(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
Send indicates an expected call of Send.