mocks

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelStateRetriever

type ChannelStateRetriever struct {
	mock.Mock
}

func (*ChannelStateRetriever) NewQueryCreator

func (_m *ChannelStateRetriever) NewQueryCreator(channel string) (endorser.QueryCreator, error)

type MockChaincodeDefinition

type MockChaincodeDefinition struct {
	NameRv          string
	VersionRv       string
	EndorsementStr  string
	ValidationStr   string
	ValidationBytes []byte
	HashRv          []byte
	RequiresInitRv  bool
}

func (*MockChaincodeDefinition) CCName

func (m *MockChaincodeDefinition) CCName() string

func (*MockChaincodeDefinition) CCVersion

func (m *MockChaincodeDefinition) CCVersion() string

func (*MockChaincodeDefinition) Endorsement

func (m *MockChaincodeDefinition) Endorsement() string

func (*MockChaincodeDefinition) Hash

func (m *MockChaincodeDefinition) Hash() []byte

func (*MockChaincodeDefinition) RequiresInit

func (m *MockChaincodeDefinition) RequiresInit() bool

func (*MockChaincodeDefinition) Validation

func (m *MockChaincodeDefinition) Validation() (string, []byte)

type MockSupport

type MockSupport struct {
	*mock.Mock
	*endorser.PluginEndorser
	IsSysCCAndNotInvokableExternalRv bool
	IsSysCCRv                        bool
	ExecuteCDSResp                   *pb.Response
	ExecuteCDSEvent                  *pb.ChaincodeEvent
	ExecuteCDSError                  error
	ExecuteResp                      *pb.Response
	ExecuteEvent                     *pb.ChaincodeEvent
	ExecuteError                     error
	ChaincodeDefinitionRv            ccprovider.ChaincodeDefinition
	ChaincodeDefinitionError         error
	GetTxSimulatorRv                 *MockTxSim
	GetTxSimulatorErr                error
	CheckInstantiationPolicyError    error
	GetTransactionByIDErr            error
	CheckACLErr                      error
	SysCCMap                         map[string]struct{}
	IsJavaRV                         bool
	IsJavaErr                        error
	GetApplicationConfigRv           channelconfig.Application
	GetApplicationConfigBoolRv       bool
	DeployedCCInfoProvider           ledger.DeployedChaincodeInfoProvider
}

func (*MockSupport) ChannelState

func (s *MockSupport) ChannelState(channel string) (endorser.QueryCreator, error)

func (*MockSupport) CheckACL

func (s *MockSupport) CheckACL(channelID string, signedProp *pb.SignedProposal) error

func (*MockSupport) CheckInstantiationPolicy

func (s *MockSupport) CheckInstantiationPolicy(nameVersion string, cd ccprovider.ChaincodeDefinition) error

func (*MockSupport) Execute

func (*MockSupport) ExecuteLegacyInit

func (s *MockSupport) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, name, version string, spec *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)

func (*MockSupport) GetApplicationConfig

func (s *MockSupport) GetApplicationConfig(cid string) (channelconfig.Application, bool)

func (*MockSupport) GetChaincodeDefinition

func (s *MockSupport) GetChaincodeDefinition(channelID, chaincodeName string, txsim ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)

func (*MockSupport) GetChaincodeDeploymentSpecFS

func (s *MockSupport) GetChaincodeDeploymentSpecFS(cds *pb.ChaincodeDeploymentSpec) (*pb.ChaincodeDeploymentSpec, error)

func (*MockSupport) GetDeployedCCInfoProvider

func (s *MockSupport) GetDeployedCCInfoProvider() ledger.DeployedChaincodeInfoProvider

func (*MockSupport) GetHistoryQueryExecutor

func (s *MockSupport) GetHistoryQueryExecutor(ledgername string) (ledger.HistoryQueryExecutor, error)

func (*MockSupport) GetLedgerHeight

func (s *MockSupport) GetLedgerHeight(channelID string) (uint64, error)

func (*MockSupport) GetTransactionByID

func (s *MockSupport) GetTransactionByID(chid, txID string) (*pb.ProcessedTransaction, error)

func (*MockSupport) GetTxSimulator

func (s *MockSupport) GetTxSimulator(ledgername string, txid string) (ledger.TxSimulator, error)

func (*MockSupport) IsSysCC

func (s *MockSupport) IsSysCC(name string) bool

func (*MockSupport) IsSysCCAndNotInvokableExternal

func (s *MockSupport) IsSysCCAndNotInvokableExternal(name string) bool

func (*MockSupport) NewQueryCreator

func (s *MockSupport) NewQueryCreator(channel string) (endorser.QueryCreator, error)

func (*MockSupport) Serialize

func (s *MockSupport) Serialize() ([]byte, error)

func (*MockSupport) Sign

func (s *MockSupport) Sign(message []byte) ([]byte, error)

type MockTxSim

type MockTxSim struct {
	GetTxSimulationResultsRv *ledger.TxSimulationResults
}

func (*MockTxSim) DeletePrivateData

func (m *MockTxSim) DeletePrivateData(namespace, collection, key string) error

func (*MockTxSim) DeletePrivateDataMetadata

func (m *MockTxSim) DeletePrivateDataMetadata(namespace, collection, key string) error

func (*MockTxSim) DeleteState

func (m *MockTxSim) DeleteState(namespace string, key string) error

func (*MockTxSim) DeleteStateMetadata

func (m *MockTxSim) DeleteStateMetadata(namespace, key string) error

func (*MockTxSim) Done

func (m *MockTxSim) Done()

func (*MockTxSim) ExecuteQuery

func (m *MockTxSim) ExecuteQuery(namespace, query string) (commonledger.ResultsIterator, error)

func (*MockTxSim) ExecuteQueryOnPrivateData

func (m *MockTxSim) ExecuteQueryOnPrivateData(namespace, collection, query string) (commonledger.ResultsIterator, error)

func (*MockTxSim) ExecuteQueryWithMetadata

func (m *MockTxSim) ExecuteQueryWithMetadata(namespace, query string, metadata map[string]interface{}) (ledger.QueryResultsIterator, error)

func (*MockTxSim) ExecuteUpdate

func (m *MockTxSim) ExecuteUpdate(query string) error

func (*MockTxSim) GetPrivateData

func (m *MockTxSim) GetPrivateData(namespace, collection, key string) ([]byte, error)

func (*MockTxSim) GetPrivateDataHash

func (m *MockTxSim) GetPrivateDataHash(namespace, collection, key string) ([]byte, error)

func (*MockTxSim) GetPrivateDataMetadata

func (m *MockTxSim) GetPrivateDataMetadata(namespace, collection, key string) (map[string][]byte, error)

func (*MockTxSim) GetPrivateDataMetadataByHash

func (m *MockTxSim) GetPrivateDataMetadataByHash(namespace, collection string, keyhash []byte) (map[string][]byte, error)

func (*MockTxSim) GetPrivateDataMultipleKeys

func (m *MockTxSim) GetPrivateDataMultipleKeys(namespace, collection string, keys []string) ([][]byte, error)

func (*MockTxSim) GetPrivateDataRangeScanIterator

func (m *MockTxSim) GetPrivateDataRangeScanIterator(namespace, collection, startKey, endKey string) (commonledger.ResultsIterator, error)

func (*MockTxSim) GetState

func (m *MockTxSim) GetState(namespace string, key string) ([]byte, error)

func (*MockTxSim) GetStateMetadata

func (m *MockTxSim) GetStateMetadata(namespace, key string) (map[string][]byte, error)

func (*MockTxSim) GetStateMultipleKeys

func (m *MockTxSim) GetStateMultipleKeys(namespace string, keys []string) ([][]byte, error)

func (*MockTxSim) GetStateRangeScanIterator

func (m *MockTxSim) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (commonledger.ResultsIterator, error)

func (*MockTxSim) GetStateRangeScanIteratorWithMetadata

func (m *MockTxSim) GetStateRangeScanIteratorWithMetadata(namespace string, startKey, endKey string, metadata map[string]interface{}) (ledger.QueryResultsIterator, error)

func (*MockTxSim) GetTxSimulationResults

func (m *MockTxSim) GetTxSimulationResults() (*ledger.TxSimulationResults, error)

func (*MockTxSim) SetPrivateData

func (m *MockTxSim) SetPrivateData(namespace, collection, key string, value []byte) error

func (*MockTxSim) SetPrivateDataMetadata

func (m *MockTxSim) SetPrivateDataMetadata(namespace, collection, key string, metadata map[string][]byte) error

func (*MockTxSim) SetPrivateDataMultipleKeys

func (m *MockTxSim) SetPrivateDataMultipleKeys(namespace, collection string, kvs map[string][]byte) error

func (*MockTxSim) SetState

func (m *MockTxSim) SetState(namespace string, key string, value []byte) error

func (*MockTxSim) SetStateMetadata

func (m *MockTxSim) SetStateMetadata(namespace, key string, metadata map[string][]byte) error

func (*MockTxSim) SetStateMultipleKeys

func (m *MockTxSim) SetStateMultipleKeys(namespace string, kvs map[string][]byte) error

type Plugin

type Plugin struct {
	mock.Mock
}

func (*Plugin) Endorse

func (_m *Plugin) Endorse(payload []byte, sp *peer.SignedProposal) (*peer.Endorsement, []byte, error)

func (*Plugin) Init

func (_m *Plugin) Init(dependencies ...endorsement.Dependency) error

type PluginFactory

type PluginFactory struct {
	mock.Mock
}

func (*PluginFactory) New

func (_m *PluginFactory) New() endorsement.Plugin

type PluginMapper

type PluginMapper struct {
	mock.Mock
}

func (*PluginMapper) PluginFactoryByName

func (_m *PluginMapper) PluginFactoryByName(name endorser.PluginName) endorsement.PluginFactory

type QueryCreator

type QueryCreator struct {
	mock.Mock
}

func (*QueryCreator) NewQueryExecutor

func (_m *QueryCreator) NewQueryExecutor() (ledger.QueryExecutor, error)

type SigningIdentityFetcher

type SigningIdentityFetcher struct {
	mock.Mock
}

func (*SigningIdentityFetcher) SigningIdentityForRequest

func (_m *SigningIdentityFetcher) SigningIdentityForRequest(_a0 *peer.SignedProposal) (endorsement.SigningIdentity, error)

type Store

type Store struct {
	mock.Mock
}

func (*Store) GetMinTransientBlkHt

func (_m *Store) GetMinTransientBlkHt() (uint64, error)

func (*Store) GetTxPvtRWSetByTxid

func (_m *Store) GetTxPvtRWSetByTxid(txid string, filter ledger.PvtNsCollFilter) (transientstore.RWSetScanner, error)

func (*Store) Persist

func (_m *Store) Persist(txid string, blockHeight uint64, privateSimulationResultsWithConfig *blockchain_protos_gotransientstore.TxPvtReadWriteSetWithConfigInfo) error

func (*Store) PurgeByHeight

func (_m *Store) PurgeByHeight(maxBlockNumToRetain uint64) error

func (*Store) PurgeByTxids

func (_m *Store) PurgeByTxids(txids []string) error

func (*Store) Shutdown

func (_m *Store) Shutdown()

type Support

type Support struct {
	CheckACLStub func(string, *peer.SignedProposal) error

	EndorseWithPluginStub func(string, string, []byte, *peer.SignedProposal) (*peer.Endorsement, []byte, error)

	ExecuteStub func(*ccprovider.TransactionParams, string, *peer.ChaincodeInput) (*peer.Response, *peer.ChaincodeEvent, error)

	ExecuteLegacyInitStub func(*ccprovider.TransactionParams, string, string, *peer.ChaincodeInput) (*peer.Response, *peer.ChaincodeEvent, error)

	GetChaincodeDefinitionStub func(string, string, ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)

	GetDeployedCCInfoProviderStub func() ledger.DeployedChaincodeInfoProvider

	GetHistoryQueryExecutorStub func(string) (ledger.HistoryQueryExecutor, error)

	GetLedgerHeightStub func(string) (uint64, error)

	GetTransactionByIDStub func(string, string) (*peer.ProcessedTransaction, error)

	GetTxSimulatorStub func(string, string) (ledger.TxSimulator, error)

	IsSysCCStub func(string) bool

	SerializeStub func() ([]byte, error)

	SignStub func([]byte) ([]byte, error)
	// contains filtered or unexported fields
}

func (*Support) CheckACL

func (fake *Support) CheckACL(arg1 string, arg2 *peer.SignedProposal) error

func (*Support) CheckACLArgsForCall

func (fake *Support) CheckACLArgsForCall(i int) (string, *peer.SignedProposal)

func (*Support) CheckACLCallCount

func (fake *Support) CheckACLCallCount() int

func (*Support) CheckACLCalls

func (fake *Support) CheckACLCalls(stub func(string, *peer.SignedProposal) error)

func (*Support) CheckACLReturns

func (fake *Support) CheckACLReturns(result1 error)

func (*Support) CheckACLReturnsOnCall

func (fake *Support) CheckACLReturnsOnCall(i int, result1 error)

func (*Support) EndorseWithPlugin

func (fake *Support) EndorseWithPlugin(arg1 string, arg2 string, arg3 []byte, arg4 *peer.SignedProposal) (*peer.Endorsement, []byte, error)

func (*Support) EndorseWithPluginArgsForCall

func (fake *Support) EndorseWithPluginArgsForCall(i int) (string, string, []byte, *peer.SignedProposal)

func (*Support) EndorseWithPluginCallCount

func (fake *Support) EndorseWithPluginCallCount() int

func (*Support) EndorseWithPluginCalls

func (fake *Support) EndorseWithPluginCalls(stub func(string, string, []byte, *peer.SignedProposal) (*peer.Endorsement, []byte, error))

func (*Support) EndorseWithPluginReturns

func (fake *Support) EndorseWithPluginReturns(result1 *peer.Endorsement, result2 []byte, result3 error)

func (*Support) EndorseWithPluginReturnsOnCall

func (fake *Support) EndorseWithPluginReturnsOnCall(i int, result1 *peer.Endorsement, result2 []byte, result3 error)

func (*Support) Execute

func (*Support) ExecuteArgsForCall

func (fake *Support) ExecuteArgsForCall(i int) (*ccprovider.TransactionParams, string, *peer.ChaincodeInput)

func (*Support) ExecuteCallCount

func (fake *Support) ExecuteCallCount() int

func (*Support) ExecuteCalls

func (*Support) ExecuteLegacyInit

func (fake *Support) ExecuteLegacyInit(arg1 *ccprovider.TransactionParams, arg2 string, arg3 string, arg4 *peer.ChaincodeInput) (*peer.Response, *peer.ChaincodeEvent, error)

func (*Support) ExecuteLegacyInitArgsForCall

func (fake *Support) ExecuteLegacyInitArgsForCall(i int) (*ccprovider.TransactionParams, string, string, *peer.ChaincodeInput)

func (*Support) ExecuteLegacyInitCallCount

func (fake *Support) ExecuteLegacyInitCallCount() int

func (*Support) ExecuteLegacyInitCalls

func (fake *Support) ExecuteLegacyInitCalls(stub func(*ccprovider.TransactionParams, string, string, *peer.ChaincodeInput) (*peer.Response, *peer.ChaincodeEvent, error))

func (*Support) ExecuteLegacyInitReturns

func (fake *Support) ExecuteLegacyInitReturns(result1 *peer.Response, result2 *peer.ChaincodeEvent, result3 error)

func (*Support) ExecuteLegacyInitReturnsOnCall

func (fake *Support) ExecuteLegacyInitReturnsOnCall(i int, result1 *peer.Response, result2 *peer.ChaincodeEvent, result3 error)

func (*Support) ExecuteReturns

func (fake *Support) ExecuteReturns(result1 *peer.Response, result2 *peer.ChaincodeEvent, result3 error)

func (*Support) ExecuteReturnsOnCall

func (fake *Support) ExecuteReturnsOnCall(i int, result1 *peer.Response, result2 *peer.ChaincodeEvent, result3 error)

func (*Support) GetChaincodeDefinition

func (fake *Support) GetChaincodeDefinition(arg1 string, arg2 string, arg3 ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)

func (*Support) GetChaincodeDefinitionArgsForCall

func (fake *Support) GetChaincodeDefinitionArgsForCall(i int) (string, string, ledger.QueryExecutor)

func (*Support) GetChaincodeDefinitionCallCount

func (fake *Support) GetChaincodeDefinitionCallCount() int

func (*Support) GetChaincodeDefinitionCalls

func (fake *Support) GetChaincodeDefinitionCalls(stub func(string, string, ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error))

func (*Support) GetChaincodeDefinitionReturns

func (fake *Support) GetChaincodeDefinitionReturns(result1 ccprovider.ChaincodeDefinition, result2 error)

func (*Support) GetChaincodeDefinitionReturnsOnCall

func (fake *Support) GetChaincodeDefinitionReturnsOnCall(i int, result1 ccprovider.ChaincodeDefinition, result2 error)

func (*Support) GetDeployedCCInfoProvider

func (fake *Support) GetDeployedCCInfoProvider() ledger.DeployedChaincodeInfoProvider

func (*Support) GetDeployedCCInfoProviderCallCount

func (fake *Support) GetDeployedCCInfoProviderCallCount() int

func (*Support) GetDeployedCCInfoProviderCalls

func (fake *Support) GetDeployedCCInfoProviderCalls(stub func() ledger.DeployedChaincodeInfoProvider)

func (*Support) GetDeployedCCInfoProviderReturns

func (fake *Support) GetDeployedCCInfoProviderReturns(result1 ledger.DeployedChaincodeInfoProvider)

func (*Support) GetDeployedCCInfoProviderReturnsOnCall

func (fake *Support) GetDeployedCCInfoProviderReturnsOnCall(i int, result1 ledger.DeployedChaincodeInfoProvider)

func (*Support) GetHistoryQueryExecutor

func (fake *Support) GetHistoryQueryExecutor(arg1 string) (ledger.HistoryQueryExecutor, error)

func (*Support) GetHistoryQueryExecutorArgsForCall

func (fake *Support) GetHistoryQueryExecutorArgsForCall(i int) string

func (*Support) GetHistoryQueryExecutorCallCount

func (fake *Support) GetHistoryQueryExecutorCallCount() int

func (*Support) GetHistoryQueryExecutorCalls

func (fake *Support) GetHistoryQueryExecutorCalls(stub func(string) (ledger.HistoryQueryExecutor, error))

func (*Support) GetHistoryQueryExecutorReturns

func (fake *Support) GetHistoryQueryExecutorReturns(result1 ledger.HistoryQueryExecutor, result2 error)

func (*Support) GetHistoryQueryExecutorReturnsOnCall

func (fake *Support) GetHistoryQueryExecutorReturnsOnCall(i int, result1 ledger.HistoryQueryExecutor, result2 error)

func (*Support) GetLedgerHeight

func (fake *Support) GetLedgerHeight(arg1 string) (uint64, error)

func (*Support) GetLedgerHeightArgsForCall

func (fake *Support) GetLedgerHeightArgsForCall(i int) string

func (*Support) GetLedgerHeightCallCount

func (fake *Support) GetLedgerHeightCallCount() int

func (*Support) GetLedgerHeightCalls

func (fake *Support) GetLedgerHeightCalls(stub func(string) (uint64, error))

func (*Support) GetLedgerHeightReturns

func (fake *Support) GetLedgerHeightReturns(result1 uint64, result2 error)

func (*Support) GetLedgerHeightReturnsOnCall

func (fake *Support) GetLedgerHeightReturnsOnCall(i int, result1 uint64, result2 error)

func (*Support) GetTransactionByID

func (fake *Support) GetTransactionByID(arg1 string, arg2 string) (*peer.ProcessedTransaction, error)

func (*Support) GetTransactionByIDArgsForCall

func (fake *Support) GetTransactionByIDArgsForCall(i int) (string, string)

func (*Support) GetTransactionByIDCallCount

func (fake *Support) GetTransactionByIDCallCount() int

func (*Support) GetTransactionByIDCalls

func (fake *Support) GetTransactionByIDCalls(stub func(string, string) (*peer.ProcessedTransaction, error))

func (*Support) GetTransactionByIDReturns

func (fake *Support) GetTransactionByIDReturns(result1 *peer.ProcessedTransaction, result2 error)

func (*Support) GetTransactionByIDReturnsOnCall

func (fake *Support) GetTransactionByIDReturnsOnCall(i int, result1 *peer.ProcessedTransaction, result2 error)

func (*Support) GetTxSimulator

func (fake *Support) GetTxSimulator(arg1 string, arg2 string) (ledger.TxSimulator, error)

func (*Support) GetTxSimulatorArgsForCall

func (fake *Support) GetTxSimulatorArgsForCall(i int) (string, string)

func (*Support) GetTxSimulatorCallCount

func (fake *Support) GetTxSimulatorCallCount() int

func (*Support) GetTxSimulatorCalls

func (fake *Support) GetTxSimulatorCalls(stub func(string, string) (ledger.TxSimulator, error))

func (*Support) GetTxSimulatorReturns

func (fake *Support) GetTxSimulatorReturns(result1 ledger.TxSimulator, result2 error)

func (*Support) GetTxSimulatorReturnsOnCall

func (fake *Support) GetTxSimulatorReturnsOnCall(i int, result1 ledger.TxSimulator, result2 error)

func (*Support) Invocations

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

func (*Support) IsSysCC

func (fake *Support) IsSysCC(arg1 string) bool

func (*Support) IsSysCCArgsForCall

func (fake *Support) IsSysCCArgsForCall(i int) string

func (*Support) IsSysCCCallCount

func (fake *Support) IsSysCCCallCount() int

func (*Support) IsSysCCCalls

func (fake *Support) IsSysCCCalls(stub func(string) bool)

func (*Support) IsSysCCReturns

func (fake *Support) IsSysCCReturns(result1 bool)

func (*Support) IsSysCCReturnsOnCall

func (fake *Support) IsSysCCReturnsOnCall(i int, result1 bool)

func (*Support) Serialize

func (fake *Support) Serialize() ([]byte, error)

func (*Support) SerializeCallCount

func (fake *Support) SerializeCallCount() int

func (*Support) SerializeCalls

func (fake *Support) SerializeCalls(stub func() ([]byte, error))

func (*Support) SerializeReturns

func (fake *Support) SerializeReturns(result1 []byte, result2 error)

func (*Support) SerializeReturnsOnCall

func (fake *Support) SerializeReturnsOnCall(i int, result1 []byte, result2 error)

func (*Support) Sign

func (fake *Support) Sign(arg1 []byte) ([]byte, error)

func (*Support) SignArgsForCall

func (fake *Support) SignArgsForCall(i int) []byte

func (*Support) SignCallCount

func (fake *Support) SignCallCount() int

func (*Support) SignCalls

func (fake *Support) SignCalls(stub func([]byte) ([]byte, error))

func (*Support) SignReturns

func (fake *Support) SignReturns(result1 []byte, result2 error)

func (*Support) SignReturnsOnCall

func (fake *Support) SignReturnsOnCall(i int, result1 []byte, result2 error)

type TransientStoreRetriever

type TransientStoreRetriever struct {
	mock.Mock
}

func (*TransientStoreRetriever) StoreForChannel

func (_m *TransientStoreRetriever) StoreForChannel(channel string) transientstore.Store

Jump to

Keyboard shortcuts

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