Documentation ¶
Index ¶
- func MockRecv(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error)
- type MockAtomicBroadcastClient
- type MockBlocksDeliverer
- func (mock *MockBlocksDeliverer) Close()
- func (mock *MockBlocksDeliverer) Disconnect(disableEndpoint bool)
- 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)
- 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) 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)
mock recv mock for the recv函数
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 { DisconnectCalled chan struct{} DisconnectAndDisableCalled chan struct{} CloseCalled chan struct{} Pos uint64 grpc.ClientStream MockRecv func(mock *MockBlocksDeliverer) (*orderer.DeliverResponse, error) // contains filtered or unexported fields }
要初始化的BlocksDeliverer接口的Mocking结构 块提供程序实现
func (*MockBlocksDeliverer) Close ¶
func (mock *MockBlocksDeliverer) Close()
func (*MockBlocksDeliverer) Disconnect ¶
func (mock *MockBlocksDeliverer) Disconnect(disableEndpoint bool)
func (*MockBlocksDeliverer) GetEndpoints ¶
func (mock *MockBlocksDeliverer) GetEndpoints() []string
func (*MockBlocksDeliverer) Recv ¶
func (mock *MockBlocksDeliverer) Recv() (*orderer.DeliverResponse, error)
recv从订购服务获取响应,当前模拟返回 只有一个响应带有空块。
func (*MockBlocksDeliverer) RecvCount ¶
func (mock *MockBlocksDeliverer) RecvCount() int32
recvcount返回调用recv的次数。
func (*MockBlocksDeliverer) Send ¶
func (mock *MockBlocksDeliverer) Send(env *common.Envelope) error
send发送信封并请求订购服务块 现在被嘲笑,什么都不做
func (*MockBlocksDeliverer) UpdateEndpoints ¶
func (mock *MockBlocksDeliverer) UpdateEndpoints(endpoints []string)
type MockGossipServiceAdapter ¶
type MockGossipServiceAdapter struct { GossipBlockDisseminations chan uint64 // contains filtered or unexported fields }
用于初始化八卦服务的MockgossipsServiceAdapter模拟结构 块提供程序实现并断言数字 使用了个函数调用。
func (*MockGossipServiceAdapter) AddPayload ¶
func (mock *MockGossipServiceAdapter) AddPayload(chainID string, payload *gossip_proto.Payload) error
addPayload将八卦负载添加到本地状态传输缓冲区
func (*MockGossipServiceAdapter) AddPayloadCount ¶
func (mock *MockGossipServiceAdapter) AddPayloadCount() int32
addpayloadcount返回调用recv的次数。
func (*MockGossipServiceAdapter) Gossip ¶
func (mock *MockGossipServiceAdapter) Gossip(msg *gossip_proto.GossipMessage)
向所有同龄人传递八卦信息
func (*MockGossipServiceAdapter) PeersOfChannel ¶
func (*MockGossipServiceAdapter) PeersOfChannel(gossip_common.ChainID) []discovery.NetworkMember
peersofchannel返回具有参与给定通道的对等方的切片
type MockLedgerInfo ¶
type MockLedgerInfo struct {
Height uint64
}
mockledgerinfo需要的ledgerinfo接口的mocking实现 用于测试初始化
func (*MockLedgerInfo) LedgerHeight ¶
func (li *MockLedgerInfo) LedgerHeight() (uint64, error)
LedgerHeight将模拟值返回到分类帐高度
Click to show internal directories.
Click to hide internal directories.