streamtest

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

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

func ExpectDecodeVote(t *testing.T, codec *mockstream.MockCodec, vote *pb.Vote)

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

func ExpectEncodeAllowed(t *testing.T, codec *mockstream.MockCodec, peerID peer.ID)

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

func ExpectEncodeVote(t *testing.T, codec *mockstream.MockCodec, r *proposal.Request)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL