func MockRecv(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error)
MockRecv mock for the Recv function
EndpointUpdater is an autogenerated mock type for the EndpointUpdater type
type EndpointUpdater struct { mock.Mock }
func (_m *EndpointUpdater) GetEndpoint() string
GetEndpoint provides a mock function with given fields:
func (_m *EndpointUpdater) UpdateEndpoints(endpoints []comm.EndpointCriteria)
UpdateEndpoints provides a mock function with given fields: endpoints
LedgerInfo is an autogenerated mock type for the LedgerInfo type
type LedgerInfo struct { mock.Mock }
func (_m *LedgerInfo) LedgerHeight() (uint64, error)
LedgerHeight provides a mock function with given fields:
MessageCryptoVerifier is an autogenerated mock type for the MessageCryptoVerifier type
type MessageCryptoVerifier struct { mock.Mock }
func (_m *MessageCryptoVerifier) VerifyHeader(chainID string, signedBlock *common.Block) error
VerifyHeader provides a mock function with given fields: chainID, signedBlock
type MockAtomicBroadcastClient struct { BD *MockBlocksDeliverer }
func (mabc *MockAtomicBroadcastClient) Broadcast(ctx context.Context, opts ...grpc.CallOption) (orderer.AtomicBroadcast_BroadcastClient, error)
func (mabc *MockAtomicBroadcastClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (orderer.AtomicBroadcast_DeliverClient, error)
MockBlocksDeliverer mocking structure of BlocksDeliverer interface to initialize the blocks provider implementation
type MockBlocksDeliverer struct { DisconnectCalled chan struct{} CloseCalled chan struct{} Pos uint64 grpc.ClientStream MockRecv func(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error) // contains filtered or unexported fields }
func (mock *MockBlocksDeliverer) Close()
func (mock *MockBlocksDeliverer) Disconnect()
func (mock *MockBlocksDeliverer) GetEndpoints() []string
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 (mock *MockBlocksDeliverer) RecvCount() int32
RecvCount returns the number of times Recv has been called.
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
func (mock *MockBlocksDeliverer) UpdateEndpoints(endpoints []string)
func (mock *MockBlocksDeliverer) UpdateReceived(blockNumber uint64)
MockGossipServiceAdapter mocking structure for gossip service, used to initialize the blocks providers implementation and asserts the number of function calls used.
type MockGossipServiceAdapter struct { GossipBlockDisseminations chan uint64 // contains filtered or unexported fields }
func (mock *MockGossipServiceAdapter) AddPayload(chainID string, payload *gossip_proto.Payload) error
AddPayload adds gossip payload to the local state transfer buffer
func (mock *MockGossipServiceAdapter) AddPayloadCount() int32
AddPayloadCount returns the number of times Recv has been called.
func (mock *MockGossipServiceAdapter) Gossip(msg *gossip_proto.GossipMessage)
Gossip message to the all peers
func (*MockGossipServiceAdapter) PeersOfChannel(gossip_common.ChainID) []discovery.NetworkMember
PeersOfChannel returns the slice with peers participating in given channel
MockLedgerInfo mocking implementation of LedgerInfo interface, needed for test initialization purposes
type MockLedgerInfo struct { Height uint64 }
func (li *MockLedgerInfo) LedgerHeight() (uint64, error)
LedgerHeight returns mocked value to the ledger height
func (li *MockLedgerInfo) Set(height uint64)
type Orderer struct { net.Listener *grpc.Server // contains filtered or unexported fields }
func NewOrderer(port int, t *testing.T) *Orderer
func (*Orderer) Broadcast(orderer.AtomicBroadcast_BroadcastServer) error
func (o *Orderer) ConnCount() int
func (o *Orderer) ConnCountType() (int, orderer.SeekInfo_SeekContentType)
func (o *Orderer) Deliver(stream orderer.AtomicBroadcast_DeliverServer) error
func (o *Orderer) Fail()
func (o *Orderer) Resurrect()
func (o *Orderer) SendBlock(seq uint64)
func (o *Orderer) SetNextExpectedSeek(seq uint64)
func (o *Orderer) Shutdown()