ccprovider

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteChaincodeResultProvider added in v1.0.1

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

type MockCcProviderImpl struct {
	ExecuteResultProvider    ExecuteChaincodeResultProvider
	ExecuteChaincodeResponse *peer.Response
}

mockCcProviderImpl is a mock implementation of the chaincode provider

func (*MockCcProviderImpl) Execute added in v1.1.0

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

func (c *MockCcProviderImpl) ExecuteChaincode(ctxt context.Context, cccid interface{}, args [][]byte) (*peer.Response, *peer.ChaincodeEvent, error)

ExecuteChaincode does nothing

func (*MockCcProviderImpl) ExecuteWithErrorFilter added in v1.1.0

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

func (c *MockCcProviderImpl) GetCCContext(cid, name, version, txid string, syscc bool, signedProp *peer.SignedProposal, prop *peer.Proposal) interface{}

GetCCContext does nothing

func (*MockCcProviderImpl) GetCCValidationInfoFromLSCC added in v1.1.0

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

GetContext does nothing

func (*MockCcProviderImpl) Stop added in v1.1.0

func (c *MockCcProviderImpl) Stop(ctxt context.Context, cccid interface{}, spec *peer.ChaincodeDeploymentSpec) error

Stop stops the chaincode given context and deployment spec

type MockTxSim added in v1.1.0

type MockTxSim struct {
	GetTxSimulationResultsRv *ledger.TxSimulationResults
}

func (*MockTxSim) DeletePrivateData added in v1.1.0

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

func (*MockTxSim) DeleteState added in v1.1.0

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

func (*MockTxSim) Done added in v1.1.0

func (m *MockTxSim) Done()

func (*MockTxSim) ExecuteQuery added in v1.1.0

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

func (*MockTxSim) ExecuteQueryOnPrivateData added in v1.1.0

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

func (*MockTxSim) ExecuteUpdate added in v1.1.0

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

func (*MockTxSim) GetPrivateData added in v1.1.0

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

func (*MockTxSim) GetPrivateDataMultipleKeys added in v1.1.0

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

func (*MockTxSim) GetPrivateDataRangeScanIterator added in v1.1.0

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

func (*MockTxSim) GetState added in v1.1.0

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

func (*MockTxSim) GetStateMultipleKeys added in v1.1.0

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

func (*MockTxSim) GetStateRangeScanIterator added in v1.1.0

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

func (*MockTxSim) GetTxSimulationResults added in v1.1.0

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

func (*MockTxSim) SetPrivateData added in v1.1.0

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

func (*MockTxSim) SetPrivateDataMultipleKeys added in v1.1.0

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

func (*MockTxSim) SetState added in v1.1.0

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

func (*MockTxSim) SetStateMultipleKeys added in v1.1.0

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

Jump to

Keyboard shortcuts

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