shimtest

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStateRangeQueryIterator

type MockStateRangeQueryIterator struct {
	Closed   bool
	Stub     *MockStub
	StartKey string
	EndKey   string
	Current  *list.Element
}

func NewMockStateRangeQueryIterator

func NewMockStateRangeQueryIterator(stub *MockStub, startKey string, endKey string) *MockStateRangeQueryIterator

func (*MockStateRangeQueryIterator) Close

func (iter *MockStateRangeQueryIterator) Close() error

func (*MockStateRangeQueryIterator) HasNext

func (iter *MockStateRangeQueryIterator) HasNext() bool

func (*MockStateRangeQueryIterator) Next

type MockStub

type MockStub struct {
	Name string

	State map[string][]byte

	Keys *list.List

	Invokables map[string]*MockStub

	TxID string

	TxTimestamp *timestamp.Timestamp

	ChannelID string

	PvtState map[string]map[string][]byte

	EndorsementPolicies map[string]map[string][]byte

	ChaincodeEventsChannel chan *pb.ChaincodeEvent

	Creator []byte

	Decorations map[string][]byte
	// contains filtered or unexported fields
}

func NewMockStub

func NewMockStub(name string, cc shim.Chaincode) *MockStub

func (*MockStub) CreateCompositeKey

func (stub *MockStub) CreateCompositeKey(objectType string, attributes []string) (string, error)

func (*MockStub) DelPrivateData

func (stub *MockStub) DelPrivateData(collection string, key string) error

func (*MockStub) DelState

func (stub *MockStub) DelState(key string) error

func (*MockStub) GetArgs

func (stub *MockStub) GetArgs() [][]byte

func (*MockStub) GetArgsSlice

func (stub *MockStub) GetArgsSlice() ([]byte, error)

func (*MockStub) GetBinding

func (stub *MockStub) GetBinding() ([]byte, error)

func (*MockStub) GetChannelID

func (stub *MockStub) GetChannelID() string

func (*MockStub) GetCreator

func (stub *MockStub) GetCreator() ([]byte, error)

func (*MockStub) GetDecorations

func (stub *MockStub) GetDecorations() map[string][]byte

func (*MockStub) GetFunctionAndParameters

func (stub *MockStub) GetFunctionAndParameters() (function string, params []string)

func (*MockStub) GetHistoryForKey

func (stub *MockStub) GetHistoryForKey(key string) (shim.HistoryQueryIteratorInterface, error)

func (*MockStub) GetPrivateData

func (stub *MockStub) GetPrivateData(collection string, key string) ([]byte, error)

func (*MockStub) GetPrivateDataByPartialCompositeKey

func (stub *MockStub) GetPrivateDataByPartialCompositeKey(collection, objectType string, attributes []string) (shim.StateQueryIteratorInterface, error)

func (*MockStub) GetPrivateDataByRange

func (stub *MockStub) GetPrivateDataByRange(collection, startKey, endKey string) (shim.StateQueryIteratorInterface, error)

func (*MockStub) GetPrivateDataHash

func (stub *MockStub) GetPrivateDataHash(collection, key string) ([]byte, error)

func (*MockStub) GetPrivateDataQueryResult

func (stub *MockStub) GetPrivateDataQueryResult(collection, query string) (shim.StateQueryIteratorInterface, error)

func (*MockStub) GetPrivateDataValidationParameter

func (stub *MockStub) GetPrivateDataValidationParameter(collection, key string) ([]byte, error)

func (*MockStub) GetQueryResult

func (stub *MockStub) GetQueryResult(query string) (shim.StateQueryIteratorInterface, error)

func (*MockStub) GetQueryResultWithPagination

func (stub *MockStub) GetQueryResultWithPagination(query string, pageSize int32,
	bookmark string) (shim.StateQueryIteratorInterface, *pb.QueryResponseMetadata, error)

func (*MockStub) GetSignedProposal

func (stub *MockStub) GetSignedProposal() (*pb.SignedProposal, error)

func (*MockStub) GetState

func (stub *MockStub) GetState(key string) ([]byte, error)

func (*MockStub) GetStateByPartialCompositeKey

func (stub *MockStub) GetStateByPartialCompositeKey(objectType string, attributes []string) (shim.StateQueryIteratorInterface, error)

func (*MockStub) GetStateByPartialCompositeKeyWithPagination

func (stub *MockStub) GetStateByPartialCompositeKeyWithPagination(objectType string, keys []string,
	pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *pb.QueryResponseMetadata, error)

func (*MockStub) GetStateByRange

func (stub *MockStub) GetStateByRange(startKey, endKey string) (shim.StateQueryIteratorInterface, error)

func (*MockStub) GetStateByRangeWithPagination

func (stub *MockStub) GetStateByRangeWithPagination(startKey, endKey string, pageSize int32,
	bookmark string) (shim.StateQueryIteratorInterface, *pb.QueryResponseMetadata, error)

func (*MockStub) GetStateValidationParameter

func (stub *MockStub) GetStateValidationParameter(key string) ([]byte, error)

func (*MockStub) GetStringArgs

func (stub *MockStub) GetStringArgs() []string

func (*MockStub) GetTransient

func (stub *MockStub) GetTransient() (map[string][]byte, error)

func (*MockStub) GetTxID

func (stub *MockStub) GetTxID() string

func (*MockStub) GetTxTimestamp

func (stub *MockStub) GetTxTimestamp() (*timestamp.Timestamp, error)

func (*MockStub) InvokeChaincode

func (stub *MockStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response

func (*MockStub) MockInit

func (stub *MockStub) MockInit(uuid string, args [][]byte) pb.Response

func (*MockStub) MockInvoke

func (stub *MockStub) MockInvoke(uuid string, args [][]byte) pb.Response

func (*MockStub) MockInvokeWithSignedProposal

func (stub *MockStub) MockInvokeWithSignedProposal(uuid string, args [][]byte, sp *pb.SignedProposal) pb.Response

func (*MockStub) MockPeerChaincode

func (stub *MockStub) MockPeerChaincode(invokableChaincodeName string, otherStub *MockStub, channel string)

func (*MockStub) MockTransactionEnd

func (stub *MockStub) MockTransactionEnd(uuid string)

func (*MockStub) MockTransactionStart

func (stub *MockStub) MockTransactionStart(txid string)

func (*MockStub) PutPrivateData

func (stub *MockStub) PutPrivateData(collection string, key string, value []byte) error

func (*MockStub) PutState

func (stub *MockStub) PutState(key string, value []byte) error

func (*MockStub) SetEvent

func (stub *MockStub) SetEvent(name string, payload []byte) error

func (*MockStub) SetPrivateDataValidationParameter

func (stub *MockStub) SetPrivateDataValidationParameter(collection, key string, ep []byte) error

func (*MockStub) SetStateValidationParameter

func (stub *MockStub) SetStateValidationParameter(key string, ep []byte) error

func (*MockStub) SplitCompositeKey

func (stub *MockStub) SplitCompositeKey(compositeKey string) (string, []string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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