Documentation ¶
Index ¶
- func ExpectDecodeConfig(t *testing.T, codec *mockstream.MockCodec, cfg *protectorpb.NetworkConfig)
- func ExpectDecodeNodeID(t *testing.T, codec *mockstream.MockCodec, nodeID *pb.NodeIdentity)
- func ExpectDecodeUpdateProp(t *testing.T, codec *mockstream.MockCodec, prop *pb.UpdateProposal)
- func ExpectDecodeVote(t *testing.T, codec *mockstream.MockCodec, vote *pb.Vote)
- func ExpectEncodeAck(t *testing.T, codec *mockstream.MockCodec, err error)
- func ExpectEncodeAllowed(t *testing.T, codec *mockstream.MockCodec, peerID peer.ID)
- func ExpectEncodeNetworkState(t *testing.T, codec *mockstream.MockCodec, state protectorpb.NetworkState)
- func ExpectEncodeVote(t *testing.T, codec *mockstream.MockCodec, r *proposal.Request)
- func ExpectStreamPeerAndProtocol(t *testing.T, p *mockstream.MockProvider, peerID peer.ID, pid protocol.ID, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectDecodeConfig ¶
func ExpectDecodeConfig(t *testing.T, codec *mockstream.MockCodec, cfg *protectorpb.NetworkConfig)
ExpectDecodeConfig configures a mock codec to decode the given network config.
func ExpectDecodeNodeID ¶
func ExpectDecodeNodeID(t *testing.T, codec *mockstream.MockCodec, nodeID *pb.NodeIdentity)
ExpectDecodeNodeID configures a mock codec to decode the given nodeID.
func ExpectDecodeUpdateProp ¶
func ExpectDecodeUpdateProp(t *testing.T, codec *mockstream.MockCodec, prop *pb.UpdateProposal)
ExpectDecodeUpdateProp configures a mock codec to decode the given network proposal.
func ExpectDecodeVote ¶
ExpectDecodeVote configures a mock codec to decode the given vote.
func ExpectEncodeAck ¶
func ExpectEncodeAck(t *testing.T, codec *mockstream.MockCodec, err error)
ExpectEncodeAck configures a mock codec to encode an Ack with the given error.
func ExpectEncodeAllowed ¶
ExpectEncodeAllowed configures a mock codec to verify that the encoded network configuration contains a specific peer.
func ExpectEncodeNetworkState ¶
func ExpectEncodeNetworkState(t *testing.T, codec *mockstream.MockCodec, state protectorpb.NetworkState)
ExpectEncodeNetworkState configures a mock codec to verify that the encoded network configuration has the given network state.
func ExpectEncodeVote ¶
ExpectEncodeVote configures a mock codec to verify that the encoded vote is a valid vote for the given request.
func ExpectStreamPeerAndProtocol ¶
func ExpectStreamPeerAndProtocol( t *testing.T, p *mockstream.MockProvider, peerID peer.ID, pid protocol.ID, stream streamutil.Stream, err error, )
ExpectStreamPeerAndProtocol configures a mock provider to expect a stream to the given peer with the given protocol. It then returns the given stream and error.
Types ¶
This section is empty.