Documentation ¶
Index ¶
- type ExecuteChaincodeResultProvider
- type MockCcProviderFactory
- type MockCcProviderImpl
- func (c *MockCcProviderImpl) Execute(ctxt context.Context, cccid interface{}, spec interface{}) (*peer.Response, *peer.ChaincodeEvent, error)
- func (c *MockCcProviderImpl) ExecuteChaincode(ctxt context.Context, cccid interface{}, args [][]byte) (*peer.Response, *peer.ChaincodeEvent, error)
- func (c *MockCcProviderImpl) ExecuteWithErrorFilter(ctxt context.Context, cccid interface{}, spec interface{}) ([]byte, *peer.ChaincodeEvent, error)
- func (c *MockCcProviderImpl) GetCCContext(cid, name, version, txid string, syscc bool, signedProp *peer.SignedProposal, ...) interface{}
- func (c *MockCcProviderImpl) GetCCValidationInfoFromLSCC(ctxt context.Context, txid string, signedProp *peer.SignedProposal, ...) (string, []byte, error)
- func (c *MockCcProviderImpl) GetContext(ledger ledger.PeerLedger, txid string) (context.Context, ledger.TxSimulator, error)
- func (c *MockCcProviderImpl) Stop(ctxt context.Context, cccid interface{}, spec *peer.ChaincodeDeploymentSpec) error
- type MockTxSim
- func (m *MockTxSim) DeletePrivateData(namespace, collection, key string) error
- func (m *MockTxSim) DeleteState(namespace string, key string) error
- func (m *MockTxSim) Done()
- func (m *MockTxSim) ExecuteQuery(namespace, query string) (commonledger.ResultsIterator, error)
- func (m *MockTxSim) ExecuteQueryOnPrivateData(namespace, collection, query string) (commonledger.ResultsIterator, error)
- func (m *MockTxSim) ExecuteUpdate(query string) error
- func (m *MockTxSim) GetPrivateData(namespace, collection, key string) ([]byte, error)
- func (m *MockTxSim) GetPrivateDataMultipleKeys(namespace, collection string, keys []string) ([][]byte, error)
- func (m *MockTxSim) GetPrivateDataRangeScanIterator(namespace, collection, startKey, endKey string) (commonledger.ResultsIterator, error)
- func (m *MockTxSim) GetState(namespace string, key string) ([]byte, error)
- func (m *MockTxSim) GetStateMultipleKeys(namespace string, keys []string) ([][]byte, error)
- func (m *MockTxSim) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (commonledger.ResultsIterator, error)
- func (m *MockTxSim) GetTxSimulationResults() (*ledger.TxSimulationResults, error)
- func (m *MockTxSim) SetPrivateData(namespace, collection, key string, value []byte) error
- func (m *MockTxSim) SetPrivateDataMultipleKeys(namespace, collection string, kvs map[string][]byte) error
- func (m *MockTxSim) SetState(namespace string, key string, value []byte) error
- func (m *MockTxSim) SetStateMultipleKeys(namespace string, kvs map[string][]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecuteChaincodeResultProvider ¶
type ExecuteChaincodeResultProvider interface {
ExecuteChaincodeResult() (*peer.Response, *peer.ChaincodeEvent, error)
}
type MockCcProviderFactory ¶
type MockCcProviderFactory struct {
ExecuteResultProvider ExecuteChaincodeResultProvider
}
MockCcProviderFactory is a factory that returns mock implementations of the ccprovider.ChaincodeProvider interface
func (*MockCcProviderFactory) NewChaincodeProvider ¶
func (c *MockCcProviderFactory) NewChaincodeProvider() ccprovider.ChaincodeProvider
NewChaincodeProvider returns a mock implementation of the ccprovider.ChaincodeProvider interface
type MockCcProviderImpl ¶
type MockCcProviderImpl struct { ExecuteResultProvider ExecuteChaincodeResultProvider ExecuteChaincodeResponse *peer.Response }
mockCcProviderImpl is a mock implementation of the chaincode provider
func (*MockCcProviderImpl) Execute ¶
func (c *MockCcProviderImpl) Execute(ctxt context.Context, cccid interface{}, spec interface{}) (*peer.Response, *peer.ChaincodeEvent, error)
Execute executes the chaincode given context and spec (invocation or deploy)
func (*MockCcProviderImpl) ExecuteChaincode ¶
func (c *MockCcProviderImpl) ExecuteChaincode(ctxt context.Context, cccid interface{}, args [][]byte) (*peer.Response, *peer.ChaincodeEvent, error)
ExecuteChaincode does nothing
func (*MockCcProviderImpl) ExecuteWithErrorFilter ¶
func (c *MockCcProviderImpl) ExecuteWithErrorFilter(ctxt context.Context, cccid interface{}, spec interface{}) ([]byte, *peer.ChaincodeEvent, error)
ExecuteWithErrorFilter executes the chaincode given context and spec and returns payload
func (*MockCcProviderImpl) GetCCContext ¶
func (c *MockCcProviderImpl) GetCCContext(cid, name, version, txid string, syscc bool, signedProp *peer.SignedProposal, prop *peer.Proposal) interface{}
GetCCContext does nothing
func (*MockCcProviderImpl) GetCCValidationInfoFromLSCC ¶
func (c *MockCcProviderImpl) GetCCValidationInfoFromLSCC(ctxt context.Context, txid string, signedProp *peer.SignedProposal, prop *peer.Proposal, chainID string, chaincodeID string) (string, []byte, error)
GetCCValidationInfoFromLSCC does nothing
func (*MockCcProviderImpl) GetContext ¶
func (c *MockCcProviderImpl) GetContext(ledger ledger.PeerLedger, txid string) (context.Context, ledger.TxSimulator, error)
GetContext does nothing
func (*MockCcProviderImpl) Stop ¶
func (c *MockCcProviderImpl) Stop(ctxt context.Context, cccid interface{}, spec *peer.ChaincodeDeploymentSpec) error
Stop stops the chaincode given context and deployment spec
type MockTxSim ¶
type MockTxSim struct {
GetTxSimulationResultsRv *ledger.TxSimulationResults
}
func (*MockTxSim) DeletePrivateData ¶
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) ExecuteUpdate ¶
func (*MockTxSim) GetPrivateData ¶
func (*MockTxSim) GetPrivateDataMultipleKeys ¶
func (*MockTxSim) GetPrivateDataRangeScanIterator ¶
func (m *MockTxSim) GetPrivateDataRangeScanIterator(namespace, collection, startKey, endKey string) (commonledger.ResultsIterator, error)
func (*MockTxSim) GetStateMultipleKeys ¶
func (*MockTxSim) GetStateRangeScanIterator ¶
func (m *MockTxSim) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (commonledger.ResultsIterator, error)
func (*MockTxSim) GetTxSimulationResults ¶
func (m *MockTxSim) GetTxSimulationResults() (*ledger.TxSimulationResults, error)