Documentation ¶
Index ¶
- func MockRecv(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error)
- type EndpointUpdater
- type HeaderStreamClient
- func (_m *HeaderStreamClient) Close()
- func (_m *HeaderStreamClient) Disconnect()
- func (_m *HeaderStreamClient) GetEndpoint() string
- func (_m *HeaderStreamClient) Recv() (*orderer.DeliverResponse, error)
- func (_m *HeaderStreamClient) Send(_a0 *common.Envelope) error
- func (_m *HeaderStreamClient) UpdateEndpoints(endpoints []comm.EndpointCriteria)
- func (_m *HeaderStreamClient) UpdateReceived(blockNumber uint64)
- type LedgerInfo
- type MessageCryptoVerifier
- type MockAtomicBroadcastClient
- type MockBlocksDeliverer
- func (mock *MockBlocksDeliverer) Close()
- func (mock *MockBlocksDeliverer) Disconnect()
- func (mock *MockBlocksDeliverer) GetEndpoints() []string
- func (mock *MockBlocksDeliverer) Recv() (*orderer.DeliverResponse, error)
- func (mock *MockBlocksDeliverer) RecvCount() int32
- func (mock *MockBlocksDeliverer) Send(env *common.Envelope) error
- func (mock *MockBlocksDeliverer) UpdateEndpoints(endpoints []string)
- func (mock *MockBlocksDeliverer) UpdateReceived(blockNumber uint64)
- type MockGossipServiceAdapter
- func (mock *MockGossipServiceAdapter) AddPayload(chainID string, payload *gossip_proto.Payload) error
- func (mock *MockGossipServiceAdapter) AddPayloadCount() int32
- func (mock *MockGossipServiceAdapter) Gossip(msg *gossip_proto.GossipMessage)
- func (*MockGossipServiceAdapter) PeersOfChannel(gossip_common.ChainID) []discovery.NetworkMember
- type MockLedgerInfo
- type 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()
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 EndpointUpdater ¶
EndpointUpdater is an autogenerated mock type for the EndpointUpdater type
func (*EndpointUpdater) GetEndpoint ¶
func (_m *EndpointUpdater) GetEndpoint() string
GetEndpoint provides a mock function with given fields:
func (*EndpointUpdater) UpdateEndpoints ¶
func (_m *EndpointUpdater) UpdateEndpoints(endpoints []comm.EndpointCriteria)
UpdateEndpoints provides a mock function with given fields: endpoints
type HeaderStreamClient ¶
HeaderStreamClient is an autogenerated mock type for the HeaderStreamClient type
func (*HeaderStreamClient) Close ¶
func (_m *HeaderStreamClient) Close()
Close provides a mock function with given fields:
func (*HeaderStreamClient) Disconnect ¶
func (_m *HeaderStreamClient) Disconnect()
Disconnect provides a mock function with given fields:
func (*HeaderStreamClient) GetEndpoint ¶
func (_m *HeaderStreamClient) GetEndpoint() string
GetEndpoint provides a mock function with given fields:
func (*HeaderStreamClient) Recv ¶
func (_m *HeaderStreamClient) Recv() (*orderer.DeliverResponse, error)
Recv provides a mock function with given fields:
func (*HeaderStreamClient) Send ¶
func (_m *HeaderStreamClient) Send(_a0 *common.Envelope) error
Send provides a mock function with given fields: _a0
func (*HeaderStreamClient) UpdateEndpoints ¶
func (_m *HeaderStreamClient) UpdateEndpoints(endpoints []comm.EndpointCriteria)
UpdateEndpoints provides a mock function with given fields: endpoints
func (*HeaderStreamClient) UpdateReceived ¶
func (_m *HeaderStreamClient) UpdateReceived(blockNumber uint64)
UpdateReceived provides a mock function with given fields: blockNumber
type LedgerInfo ¶
LedgerInfo is an autogenerated mock type for the LedgerInfo type
func (*LedgerInfo) LedgerHeight ¶
func (_m *LedgerInfo) LedgerHeight() (uint64, error)
LedgerHeight provides a mock function with given fields:
type MessageCryptoVerifier ¶
MessageCryptoVerifier is an autogenerated mock type for the MessageCryptoVerifier type
func (*MessageCryptoVerifier) VerifyHeader ¶
func (_m *MessageCryptoVerifier) VerifyHeader(chainID string, signedBlock *common.Block) error
VerifyHeader provides a mock function with given fields: chainID, signedBlock
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 { DisconnectCalled chan struct{} CloseCalled chan struct{} Pos uint64 grpc.ClientStream MockRecv func(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error) // contains filtered or unexported fields }
MockBlocksDeliverer mocking structure of BlocksDeliverer interface to initialize the blocks provider implementation
func (*MockBlocksDeliverer) Close ¶
func (mock *MockBlocksDeliverer) Close()
func (*MockBlocksDeliverer) Disconnect ¶
func (mock *MockBlocksDeliverer) Disconnect()
func (*MockBlocksDeliverer) GetEndpoints ¶
func (mock *MockBlocksDeliverer) GetEndpoints() []string
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) RecvCount ¶
func (mock *MockBlocksDeliverer) RecvCount() int32
RecvCount returns the number of times Recv has been called.
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
func (*MockBlocksDeliverer) UpdateEndpoints ¶
func (mock *MockBlocksDeliverer) UpdateEndpoints(endpoints []string)
func (*MockBlocksDeliverer) UpdateReceived ¶
func (mock *MockBlocksDeliverer) UpdateReceived(blockNumber uint64)
type MockGossipServiceAdapter ¶
type MockGossipServiceAdapter struct { GossipBlockDisseminations chan uint64 // contains filtered or unexported fields }
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) AddPayloadCount ¶
func (mock *MockGossipServiceAdapter) AddPayloadCount() int32
AddPayloadCount returns the number of times Recv has been called.
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
func (*MockLedgerInfo) Set ¶
func (li *MockLedgerInfo) Set(height uint64)
type Orderer ¶
func (*Orderer) Broadcast ¶
func (*Orderer) Broadcast(orderer.AtomicBroadcast_BroadcastServer) error
func (*Orderer) ConnCountType ¶
func (o *Orderer) ConnCountType() (int, orderer.SeekInfo_SeekContentType)
func (*Orderer) Deliver ¶
func (o *Orderer) Deliver(stream orderer.AtomicBroadcast_DeliverServer) error