Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockRecv ¶
func MockRecv(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error)
MockRecv mock for the Recv function
Types ¶
type MockAtomicBroadcastClient ¶
type MockAtomicBroadcastClient struct {
BD *MockBlocksDeliverer
}
func (*MockAtomicBroadcastClient) Broadcast ¶
func (mabc *MockAtomicBroadcastClient) Broadcast(ctx context.Context, opts ...grpc.CallOption) (orderer.AtomicBroadcast_BroadcastClient, error)
func (*MockAtomicBroadcastClient) Deliver ¶
func (mabc *MockAtomicBroadcastClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (orderer.AtomicBroadcast_DeliverClient, error)
type MockBlocksDeliverer ¶
type MockBlocksDeliverer struct { Pos uint64 grpc.ClientStream RecvCnt int32 MockRecv func(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error) }
MockBlocksDeliverer mocking structure of BlocksDeliverer interface to initialize the blocks provider implementation
func (*MockBlocksDeliverer) Close ¶
func (mock *MockBlocksDeliverer) Close()
func (*MockBlocksDeliverer) Recv ¶
func (mock *MockBlocksDeliverer) Recv() (*orderer.DeliverResponse, error)
Recv gets responses from the ordering service, currently mocked to return only one response with empty block.
func (*MockBlocksDeliverer) Send ¶
func (mock *MockBlocksDeliverer) Send(env *common.Envelope) error
Send sends the envelope with request for the blocks for ordering service currently mocked and not doing anything
type MockGossipServiceAdapter ¶
MockGossipServiceAdapter mocking structure for gossip service, used to initialize the blocks providers implementation and asserts the number of function calls used.
func (*MockGossipServiceAdapter) AddPayload ¶
func (mock *MockGossipServiceAdapter) AddPayload(chainID string, payload *gossip_proto.Payload) error
AddPayload adds gossip payload to the local state transfer buffer
func (*MockGossipServiceAdapter) Gossip ¶
func (mock *MockGossipServiceAdapter) Gossip(msg *gossip_proto.GossipMessage)
Gossip message to the all peers
func (*MockGossipServiceAdapter) PeersOfChannel ¶
func (*MockGossipServiceAdapter) PeersOfChannel(gossip_common.ChainID) []discovery.NetworkMember
PeersOfChannel returns the slice with peers participating in given channel
type MockLedgerInfo ¶
type MockLedgerInfo struct {
Height uint64
}
MockLedgerInfo mocking implementation of LedgerInfo interface, needed for test initialization purposes
func (*MockLedgerInfo) LedgerHeight ¶
func (li *MockLedgerInfo) LedgerHeight() (uint64, error)
LedgerHeight returns mocked value to the ledger height