|
@ -137,7 +137,7 @@ func (n *Network) NodeIDs() []types.NodeID { |
|
|
// doing error checks and cleanups.
|
|
|
// doing error checks and cleanups.
|
|
|
func (n *Network) MakeChannels( |
|
|
func (n *Network) MakeChannels( |
|
|
t *testing.T, |
|
|
t *testing.T, |
|
|
chDesc p2p.ChannelDescriptor, |
|
|
|
|
|
|
|
|
chDesc *p2p.ChannelDescriptor, |
|
|
messageType proto.Message, |
|
|
messageType proto.Message, |
|
|
size int, |
|
|
size int, |
|
|
) map[types.NodeID]*p2p.Channel { |
|
|
) map[types.NodeID]*p2p.Channel { |
|
@ -153,7 +153,7 @@ func (n *Network) MakeChannels( |
|
|
// all the channels.
|
|
|
// all the channels.
|
|
|
func (n *Network) MakeChannelsNoCleanup( |
|
|
func (n *Network) MakeChannelsNoCleanup( |
|
|
t *testing.T, |
|
|
t *testing.T, |
|
|
chDesc p2p.ChannelDescriptor, |
|
|
|
|
|
|
|
|
chDesc *p2p.ChannelDescriptor, |
|
|
messageType proto.Message, |
|
|
messageType proto.Message, |
|
|
size int, |
|
|
size int, |
|
|
) map[types.NodeID]*p2p.Channel { |
|
|
) map[types.NodeID]*p2p.Channel { |
|
@ -281,7 +281,7 @@ func (n *Network) MakeNode(t *testing.T, opts NodeOptions) *Node { |
|
|
// MakeChannel opens a channel, with automatic error handling and cleanup. On
|
|
|
// MakeChannel opens a channel, with automatic error handling and cleanup. On
|
|
|
// test cleanup, it also checks that the channel is empty, to make sure
|
|
|
// test cleanup, it also checks that the channel is empty, to make sure
|
|
|
// all expected messages have been asserted.
|
|
|
// all expected messages have been asserted.
|
|
|
func (n *Node) MakeChannel(t *testing.T, chDesc p2p.ChannelDescriptor, |
|
|
|
|
|
|
|
|
func (n *Node) MakeChannel(t *testing.T, chDesc *p2p.ChannelDescriptor, |
|
|
messageType proto.Message, size int) *p2p.Channel { |
|
|
messageType proto.Message, size int) *p2p.Channel { |
|
|
channel, err := n.Router.OpenChannel(chDesc, messageType, size) |
|
|
channel, err := n.Router.OpenChannel(chDesc, messageType, size) |
|
|
require.NoError(t, err) |
|
|
require.NoError(t, err) |
|
@ -297,7 +297,7 @@ func (n *Node) MakeChannel(t *testing.T, chDesc p2p.ChannelDescriptor, |
|
|
// caller must ensure proper cleanup of the channel.
|
|
|
// caller must ensure proper cleanup of the channel.
|
|
|
func (n *Node) MakeChannelNoCleanup( |
|
|
func (n *Node) MakeChannelNoCleanup( |
|
|
t *testing.T, |
|
|
t *testing.T, |
|
|
chDesc p2p.ChannelDescriptor, |
|
|
|
|
|
|
|
|
chDesc *p2p.ChannelDescriptor, |
|
|
messageType proto.Message, |
|
|
messageType proto.Message, |
|
|
size int, |
|
|
size int, |
|
|
) *p2p.Channel { |
|
|
) *p2p.Channel { |
|
@ -333,8 +333,8 @@ func (n *Node) MakePeerUpdatesNoRequireEmpty(t *testing.T) *p2p.PeerUpdates { |
|
|
return sub |
|
|
return sub |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func MakeChannelDesc(chID p2p.ChannelID) p2p.ChannelDescriptor { |
|
|
|
|
|
return p2p.ChannelDescriptor{ |
|
|
|
|
|
|
|
|
func MakeChannelDesc(chID p2p.ChannelID) *p2p.ChannelDescriptor { |
|
|
|
|
|
return &p2p.ChannelDescriptor{ |
|
|
ID: chID, |
|
|
ID: chID, |
|
|
Priority: 5, |
|
|
Priority: 5, |
|
|
SendQueueCapacity: 10, |
|
|
SendQueueCapacity: 10, |
|
|