mocks

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockchainClient added in v0.1.1

type BlockchainClient struct {
	GetBlockchainInfoStub func() (*cb.BlockchainInfo, error)

	GetBlockByNumberStub func(blockNumber uint64) (*cb.Block, error)

	GetBlockByHashStub func(blockHash []byte) (*cb.Block, error)
	// contains filtered or unexported fields
}

func (*BlockchainClient) GetBlockByHash added in v0.1.3

func (fake *BlockchainClient) GetBlockByHash(blockHash []byte) (*cb.Block, error)

func (*BlockchainClient) GetBlockByHashArgsForCall added in v0.1.3

func (fake *BlockchainClient) GetBlockByHashArgsForCall(i int) []byte

func (*BlockchainClient) GetBlockByHashCallCount added in v0.1.3

func (fake *BlockchainClient) GetBlockByHashCallCount() int

func (*BlockchainClient) GetBlockByHashReturns added in v0.1.3

func (fake *BlockchainClient) GetBlockByHashReturns(result1 *cb.Block, result2 error)

func (*BlockchainClient) GetBlockByHashReturnsOnCall added in v0.1.3

func (fake *BlockchainClient) GetBlockByHashReturnsOnCall(i int, result1 *cb.Block, result2 error)

func (*BlockchainClient) GetBlockByNumber added in v0.1.1

func (fake *BlockchainClient) GetBlockByNumber(blockNumber uint64) (*cb.Block, error)

func (*BlockchainClient) GetBlockByNumberArgsForCall added in v0.1.1

func (fake *BlockchainClient) GetBlockByNumberArgsForCall(i int) uint64

func (*BlockchainClient) GetBlockByNumberCallCount added in v0.1.1

func (fake *BlockchainClient) GetBlockByNumberCallCount() int

func (*BlockchainClient) GetBlockByNumberReturns added in v0.1.1

func (fake *BlockchainClient) GetBlockByNumberReturns(result1 *cb.Block, result2 error)

func (*BlockchainClient) GetBlockByNumberReturnsOnCall added in v0.1.1

func (fake *BlockchainClient) GetBlockByNumberReturnsOnCall(i int, result1 *cb.Block, result2 error)

func (*BlockchainClient) GetBlockchainInfo added in v0.1.1

func (fake *BlockchainClient) GetBlockchainInfo() (*cb.BlockchainInfo, error)

func (*BlockchainClient) GetBlockchainInfoCallCount added in v0.1.1

func (fake *BlockchainClient) GetBlockchainInfoCallCount() int

func (*BlockchainClient) GetBlockchainInfoReturns added in v0.1.1

func (fake *BlockchainClient) GetBlockchainInfoReturns(result1 *cb.BlockchainInfo, result2 error)

func (*BlockchainClient) GetBlockchainInfoReturnsOnCall added in v0.1.1

func (fake *BlockchainClient) GetBlockchainInfoReturnsOnCall(i int, result1 *cb.BlockchainInfo, result2 error)

func (*BlockchainClient) Invocations added in v0.1.1

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

type BlockchainClientProvider added in v0.1.1

type BlockchainClientProvider struct {
	ForChannelStub func(channelID string) (bcclient.Blockchain, error)
	// contains filtered or unexported fields
}

func (*BlockchainClientProvider) ForChannel added in v0.1.1

func (fake *BlockchainClientProvider) ForChannel(channelID string) (bcclient.Blockchain, error)

func (*BlockchainClientProvider) ForChannelArgsForCall added in v0.1.1

func (fake *BlockchainClientProvider) ForChannelArgsForCall(i int) string

func (*BlockchainClientProvider) ForChannelCallCount added in v0.1.1

func (fake *BlockchainClientProvider) ForChannelCallCount() int

func (*BlockchainClientProvider) ForChannelReturns added in v0.1.1

func (fake *BlockchainClientProvider) ForChannelReturns(result1 bcclient.Blockchain, result2 error)

func (*BlockchainClientProvider) ForChannelReturnsOnCall added in v0.1.1

func (fake *BlockchainClientProvider) ForChannelReturnsOnCall(i int, result1 bcclient.Blockchain, result2 error)

func (*BlockchainClientProvider) Invocations added in v0.1.1

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

type DocCacheInvalidator added in v0.1.5

type DocCacheInvalidator struct {
	InvalidateStub func(uniqueSuffix string)
	// contains filtered or unexported fields
}

func (*DocCacheInvalidator) Invalidate added in v0.1.5

func (fake *DocCacheInvalidator) Invalidate(uniqueSuffix string)

func (*DocCacheInvalidator) InvalidateArgsForCall added in v0.1.5

func (fake *DocCacheInvalidator) InvalidateArgsForCall(i int) string

func (*DocCacheInvalidator) InvalidateCallCount added in v0.1.5

func (fake *DocCacheInvalidator) InvalidateCallCount() int

func (*DocCacheInvalidator) Invocations added in v0.1.5

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

type DocCacheInvalidatorProvider added in v0.1.5

type DocCacheInvalidatorProvider struct {
	GetDocumentInvalidatorStub func(channelID, namespace string) (doccache.Invalidator, error)
	// contains filtered or unexported fields
}

func (*DocCacheInvalidatorProvider) GetDocumentInvalidator added in v0.1.5

func (fake *DocCacheInvalidatorProvider) GetDocumentInvalidator(channelID string, namespace string) (doccache.Invalidator, error)

func (*DocCacheInvalidatorProvider) GetDocumentInvalidatorArgsForCall added in v0.1.5

func (fake *DocCacheInvalidatorProvider) GetDocumentInvalidatorArgsForCall(i int) (string, string)

func (*DocCacheInvalidatorProvider) GetDocumentInvalidatorCallCount added in v0.1.5

func (fake *DocCacheInvalidatorProvider) GetDocumentInvalidatorCallCount() int

func (*DocCacheInvalidatorProvider) GetDocumentInvalidatorReturns added in v0.1.5

func (fake *DocCacheInvalidatorProvider) GetDocumentInvalidatorReturns(result1 doccache.Invalidator, result2 error)

func (*DocCacheInvalidatorProvider) GetDocumentInvalidatorReturnsOnCall added in v0.1.5

func (fake *DocCacheInvalidatorProvider) GetDocumentInvalidatorReturnsOnCall(i int, result1 doccache.Invalidator, result2 error)

func (*DocCacheInvalidatorProvider) Invocations added in v0.1.5

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

type MockOffLedgerClient

type MockOffLedgerClient struct {
	sync.RWMutex

	PutErr error
	GetErr error
	// contains filtered or unexported fields
}

MockOffLedgerClient mocks the off-ledger client

func NewMockOffLedgerClient

func NewMockOffLedgerClient() *MockOffLedgerClient

NewMockOffLedgerClient creates a mock off-ledger client

func (*MockOffLedgerClient) Delete added in v0.1.1

func (m *MockOffLedgerClient) Delete(ns, coll string, keys ...string) error

Delete deletes the given key(s)

func (*MockOffLedgerClient) Get

func (m *MockOffLedgerClient) Get(ns, coll, key string) ([]byte, error)

Get retrieves the value from mock content addressable storage

func (*MockOffLedgerClient) GetMap

func (m *MockOffLedgerClient) GetMap(ns, coll string) (map[string][]byte, error)

GetMap retrieves all values for namespace and collection

func (*MockOffLedgerClient) GetMultipleKeys added in v0.1.1

func (m *MockOffLedgerClient) GetMultipleKeys(ns, coll string, keys ...string) ([][]byte, error)

GetMultipleKeys retrieves the values for the given keys

func (*MockOffLedgerClient) Put

func (m *MockOffLedgerClient) Put(ns, coll, key string, content []byte) error

Put stores content in the off-ledger store

func (*MockOffLedgerClient) PutMultipleValues added in v0.1.1

func (m *MockOffLedgerClient) PutMultipleValues(ns, coll string, kvs []*client.KeyValue) error

PutMultipleValues puts the given key/values

func (*MockOffLedgerClient) Query added in v0.1.1

func (m *MockOffLedgerClient) Query(ns, coll, query string) (commonledger.ResultsIterator, error)

Query executes the given query and returns an iterator that contains results. Only used for state databases that support query. (Note that this function is not supported by transient data collections) The returned ResultsIterator contains results of type *KV which is defined in protos/ledger/queryresult.

func (*MockOffLedgerClient) WithDefaultQueryResults added in v0.1.5

func (m *MockOffLedgerClient) WithDefaultQueryResults(results []*queryresult.KV) *MockOffLedgerClient

WithDefaultQueryResults sets the default query results that are returned if no result was found for a given query

func (*MockOffLedgerClient) WithGetError

func (m *MockOffLedgerClient) WithGetError(err error) *MockOffLedgerClient

WithGetError injects an error when a call is made to get a value

func (*MockOffLedgerClient) WithGetErrorForKey

func (m *MockOffLedgerClient) WithGetErrorForKey(ns, coll, key string, err error) *MockOffLedgerClient

WithGetErrorForKey injects an error when a call is made to get a value for the given namespace, collection, and key

func (*MockOffLedgerClient) WithPutError

func (m *MockOffLedgerClient) WithPutError(err error) *MockOffLedgerClient

WithPutError injects an error when a call is made to put a value

func (*MockOffLedgerClient) WithPutErrorForKey

func (m *MockOffLedgerClient) WithPutErrorForKey(ns, coll, key string, err error) *MockOffLedgerClient

WithPutErrorForKey injects an error when a call is made to put a value for the given namespace, collection, and key

func (*MockOffLedgerClient) WithQueryResults added in v0.1.1

func (m *MockOffLedgerClient) WithQueryResults(ns, coll, query string, results []*queryresult.KV) *MockOffLedgerClient

WithQueryResults sets the query results for the given query

type OffLedgerClientProvider added in v0.1.1

type OffLedgerClientProvider struct {
	ForChannelStub func(channelID string) (client.OffLedger, error)
	// contains filtered or unexported fields
}

func (*OffLedgerClientProvider) ForChannel added in v0.1.1

func (fake *OffLedgerClientProvider) ForChannel(channelID string) (client.OffLedger, error)

func (*OffLedgerClientProvider) ForChannelArgsForCall added in v0.1.1

func (fake *OffLedgerClientProvider) ForChannelArgsForCall(i int) string

func (*OffLedgerClientProvider) ForChannelCallCount added in v0.1.1

func (fake *OffLedgerClientProvider) ForChannelCallCount() int

func (*OffLedgerClientProvider) ForChannelReturns added in v0.1.1

func (fake *OffLedgerClientProvider) ForChannelReturns(result1 client.OffLedger, result2 error)

func (*OffLedgerClientProvider) ForChannelReturnsOnCall added in v0.1.1

func (fake *OffLedgerClientProvider) ForChannelReturnsOnCall(i int, result1 client.OffLedger, result2 error)

func (*OffLedgerClientProvider) Invocations added in v0.1.1

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

Jump to

Keyboard shortcuts

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