mocks

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockRecv

MockRecv mock for the Recv function

Types

type ConnectionProducer added in v1.4.4

type ConnectionProducer struct {
	GetEndpointsStub func() []comm.EndpointCriteria

	NewConnectionStub func() (*grpc.ClientConn, string, error)

	UpdateEndpointsStub func([]comm.EndpointCriteria)
	// contains filtered or unexported fields
}

func (*ConnectionProducer) GetEndpoints added in v1.4.4

func (fake *ConnectionProducer) GetEndpoints() []comm.EndpointCriteria

func (*ConnectionProducer) GetEndpointsCallCount added in v1.4.4

func (fake *ConnectionProducer) GetEndpointsCallCount() int

func (*ConnectionProducer) GetEndpointsCalls added in v1.4.4

func (fake *ConnectionProducer) GetEndpointsCalls(stub func() []comm.EndpointCriteria)

func (*ConnectionProducer) GetEndpointsReturns added in v1.4.4

func (fake *ConnectionProducer) GetEndpointsReturns(result1 []comm.EndpointCriteria)

func (*ConnectionProducer) GetEndpointsReturnsOnCall added in v1.4.4

func (fake *ConnectionProducer) GetEndpointsReturnsOnCall(i int, result1 []comm.EndpointCriteria)

func (*ConnectionProducer) Invocations added in v1.4.4

func (fake *ConnectionProducer) Invocations() map[string][][]interface{}

func (*ConnectionProducer) NewConnection added in v1.4.4

func (fake *ConnectionProducer) NewConnection() (*grpc.ClientConn, string, error)

func (*ConnectionProducer) NewConnectionCallCount added in v1.4.4

func (fake *ConnectionProducer) NewConnectionCallCount() int

func (*ConnectionProducer) NewConnectionCalls added in v1.4.4

func (fake *ConnectionProducer) NewConnectionCalls(stub func() (*grpc.ClientConn, string, error))

func (*ConnectionProducer) NewConnectionReturns added in v1.4.4

func (fake *ConnectionProducer) NewConnectionReturns(result1 *grpc.ClientConn, result2 string, result3 error)

func (*ConnectionProducer) NewConnectionReturnsOnCall added in v1.4.4

func (fake *ConnectionProducer) NewConnectionReturnsOnCall(i int, result1 *grpc.ClientConn, result2 string, result3 error)

func (*ConnectionProducer) UpdateEndpoints added in v1.4.4

func (fake *ConnectionProducer) UpdateEndpoints(arg1 []comm.EndpointCriteria)

func (*ConnectionProducer) UpdateEndpointsArgsForCall added in v1.4.4

func (fake *ConnectionProducer) UpdateEndpointsArgsForCall(i int) []comm.EndpointCriteria

func (*ConnectionProducer) UpdateEndpointsCallCount added in v1.4.4

func (fake *ConnectionProducer) UpdateEndpointsCallCount() int

func (*ConnectionProducer) UpdateEndpointsCalls added in v1.4.4

func (fake *ConnectionProducer) UpdateEndpointsCalls(stub func([]comm.EndpointCriteria))

type MockAtomicBroadcastClient

type MockAtomicBroadcastClient struct {
	BD *MockBlocksDeliverer
}

func (*MockAtomicBroadcastClient) Broadcast

func (*MockAtomicBroadcastClient) Deliver

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 added in v1.1.0

func (mock *MockBlocksDeliverer) GetEndpoints() []string

func (*MockBlocksDeliverer) Recv

Recv gets responses from the ordering service, currently mocked to return only one response with empty block.

func (*MockBlocksDeliverer) RecvCount added in v1.4.0

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 added in v1.1.0

func (mock *MockBlocksDeliverer) UpdateEndpoints(endpoints []string)

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 added in v1.4.0

func (mock *MockGossipServiceAdapter) AddPayloadCount() int32

AddPayloadCount returns the number of times Recv has been called.

func (*MockGossipServiceAdapter) Gossip

Gossip message to the all peers

func (*MockGossipServiceAdapter) PeersOfChannel

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

type Orderer

type Orderer struct {
	net.Listener
	*grpc.Server
	// contains filtered or unexported fields
}

func NewOrderer

func NewOrderer(port int, t *testing.T) *Orderer

func (*Orderer) Broadcast

func (*Orderer) ConnCount

func (o *Orderer) ConnCount() int

func (*Orderer) Deliver

func (*Orderer) Fail

func (o *Orderer) Fail()

func (*Orderer) Resurrect added in v1.1.0

func (o *Orderer) Resurrect()

func (*Orderer) SendBlock

func (o *Orderer) SendBlock(seq uint64)

func (*Orderer) SetNextExpectedSeek

func (o *Orderer) SetNextExpectedSeek(seq uint64)

func (*Orderer) Shutdown

func (o *Orderer) Shutdown()

Jump to

Keyboard shortcuts

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