@gala-chain/test ∙ API
API > TestChaincodeStub
Class: TestChaincodeStub
Contents
- Extends
- Constructors
- new TestChaincodeStub(args, state, writes)
- new TestChaincodeStub(client, channel_id, txId, chaincodeInput, signedProposal)
- Properties
- creator
- deleteState
- getState
- getStateByPartialCompositeKey
- putState
- state
- writes
- creator
- epoch
- Methods
- createCompositeKey()
- deletePrivateData()
- getArgs()
- getBinding()
- getChannelID()
- getClientIdentity()
- getCreator()
- getDateTimestamp()
- getFunctionAndParameters()
- getHistoryForKey()
- getMspID()
- getPrivateData()
- getPrivateDataByPartialCompositeKey()
- getPrivateDataByRange()
- getPrivateDataHash()
- getPrivateDataQueryResult()
- getPrivateDataValidationParameter()
- getQueryResult()
- getQueryResultWithPagination()
- getSignedProposal()
- getStateByPartialCompositeKeyWithPagination()
- getStateByRange()
- getStateByRangeWithPagination()
- getStateValidationParameter()
- getStringArgs()
- getTransient()
- getTxID()
- getTxTimestamp()
- invokeChaincode()
- mockState()
- purgePrivateData()
- putPrivateData()
- setEvent()
- setPrivateDataValidationParameter()
- setStateValidationParameter()
- splitCompositeKey()
- createCompositeKey()
- deletePrivateData()
- deleteState()
- getArgs()
- getBinding()
- getChannelID()
- getCreator()
- getDateTimestamp()
- getFunctionAndParameters()
- getHistoryForKey()
- getMspID()
- getPrivateData()
- getPrivateDataByPartialCompositeKey()
- getPrivateDataByRange()
- getPrivateDataHash()
- getPrivateDataQueryResult()
- getPrivateDataValidationParameter()
- getQueryResult()
- getQueryResultWithPagination()
- getSignedProposal()
- getState()
- getStateByPartialCompositeKey()
- getStateByPartialCompositeKeyWithPagination()
- getStateByRange()
- getStateByRangeWithPagination()
- getStateValidationParameter()
- getStringArgs()
- getTransient()
- getTxID()
- getTxTimestamp()
- invokeChaincode()
- purgePrivateData()
- putPrivateData()
- putState()
- setEvent()
- setPrivateDataValidationParameter()
- setStateValidationParameter()
- splitCompositeKey()
Extends
ChaincodeStub
Constructors
new TestChaincodeStub(args, state, writes)
new TestChaincodeStub(
args,state,writes):TestChaincodeStub
Parameters
▪ args: string[]
▪ state: undefined | Record\<string, string>
▪ writes: undefined | Record\<string, string>
Overrides
ChaincodeStub.constructor
Source
chain-test/src/unit/TestChaincodeStub.ts:78
new TestChaincodeStub(client, channel_id, txId, chaincodeInput, signedProposal)
new TestChaincodeStub(
client,channel_id,txId,chaincodeInput,signedProposal):ChaincodeStubClassType
Parameters
▪ client: any
▪ channel_id: any
▪ txId: any
▪ chaincodeInput: any
▪ signedProposal: any
Overrides
ChaincodeStub.constructor
Source
chain-test/src/unit/TestChaincodeStub.ts:23
Properties
creator
creator:
unknown
Inherited from
ChaincodeStub.creator
Source
chain-test/src/unit/TestChaincodeStub.ts:25
deleteState
deleteState: (
key) =>Promise\<void>
Parameters
▪ key: string
Overrides
ChaincodeStub.deleteState
Source
chain-test/src/unit/TestChaincodeStub.ts:129
getState
getState: (
key) =>Promise\<Uint8Array>
Parameters
▪ key: string
Overrides
ChaincodeStub.getState
Source
chain-test/src/unit/TestChaincodeStub.ts:136
getStateByPartialCompositeKey
getStateByPartialCompositeKey: (
objectType,attributes) =>FabricIterable\<KV>
Parameters
▪ objectType: string
▪ attributes: string[]
Overrides
ChaincodeStub.getStateByPartialCompositeKey
Source
chain-test/src/unit/TestChaincodeStub.ts:142
putState
putState: (
key,value) =>Promise\<void>
Parameters
▪ key: string
▪ value: Uint8Array
Overrides
ChaincodeStub.putState
Source
chain-test/src/unit/TestChaincodeStub.ts:121
state
readonlystate:Record\<string,string>
Source
chain-test/src/unit/TestChaincodeStub.ts:75
writes
readonlywrites:Record\<string,string>
Source
chain-test/src/unit/TestChaincodeStub.ts:76
creator
staticcreator:unknown
Inherited from
ChaincodeStub.creator
Source
chain-test/src/unit/TestChaincodeStub.ts:25
epoch
staticprivateepoch:number=0
Source
chain-test/src/unit/TestChaincodeStub.ts:74
Methods
createCompositeKey()
createCompositeKey(
objectType,attributes):string
Parameters
▪ objectType: string
▪ attributes: string[]
Inherited from
ChaincodeStub.createCompositeKey
Source
chain-test/src/unit/TestChaincodeStub.ts:27
deletePrivateData()
deletePrivateData(
collection,key):Promise\<void>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.deletePrivateData
Source
node_modules/fabric-shim/types/index.d.ts:132
getArgs()
getArgs():
string[]
Inherited from
ChaincodeStub.getArgs
Source
node_modules/fabric-shim/types/index.d.ts:94
getBinding()
getBinding():
string
Inherited from
ChaincodeStub.getBinding
Source
node_modules/fabric-shim/types/index.d.ts:107
getChannelID()
getChannelID():
string
Inherited from
ChaincodeStub.getChannelID
Source
node_modules/fabric-shim/types/index.d.ts:99
getClientIdentity()
getClientIdentity(
caUser,mspId):ClientIdentity
Parameters
▪ caUser: string
▪ mspId: string
Source
chain-test/src/unit/TestChaincodeStub.ts:113
getCreator()
getCreator():
SerializedIdentity
Inherited from
ChaincodeStub.getCreator
Source
node_modules/fabric-shim/types/index.d.ts:100
getDateTimestamp()
getDateTimestamp():
Date
Inherited from
ChaincodeStub.getDateTimestamp
Source
node_modules/fabric-shim/types/index.d.ts:106
getFunctionAndParameters()
getFunctionAndParameters():
object
Returns
fcn
fcn:
stringparams
params:
string[]
Inherited from
ChaincodeStub.getFunctionAndParameters
Source
node_modules/fabric-shim/types/index.d.ts:96
getHistoryForKey()
getHistoryForKey(
key):Promise\<HistoryQueryIterator> &AsyncIterable\<KeyModification>
Parameters
▪ key: string
Inherited from
ChaincodeStub.getHistoryForKey
Source
node_modules/fabric-shim/types/index.d.ts:121
getMspID()
getMspID():
string
Inherited from
ChaincodeStub.getMspID
Source
node_modules/fabric-shim/types/index.d.ts:101
getPrivateData()
getPrivateData(
collection,key):Promise\<Uint8Array>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.getPrivateData
Source
node_modules/fabric-shim/types/index.d.ts:129
getPrivateDataByPartialCompositeKey()
getPrivateDataByPartialCompositeKey(
collection,objectType,attributes):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ collection: string
▪ objectType: string
▪ attributes: string[]
Inherited from
ChaincodeStub.getPrivateDataByPartialCompositeKey
Source
node_modules/fabric-shim/types/index.d.ts:137
getPrivateDataByRange()
getPrivateDataByRange(
collection,startKey,endKey):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ collection: string
▪ startKey: string
▪ endKey: string
Inherited from
ChaincodeStub.getPrivateDataByRange
Source
node_modules/fabric-shim/types/index.d.ts:136
getPrivateDataHash()
getPrivateDataHash(
collection,key):Promise\<Uint8Array>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.getPrivateDataHash
Source
node_modules/fabric-shim/types/index.d.ts:130
getPrivateDataQueryResult()
getPrivateDataQueryResult(
collection,query):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ collection: string
▪ query: string
Inherited from
ChaincodeStub.getPrivateDataQueryResult
Source
node_modules/fabric-shim/types/index.d.ts:138
getPrivateDataValidationParameter()
getPrivateDataValidationParameter(
collection,key):Promise\<Uint8Array>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.getPrivateDataValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:135
getQueryResult()
getQueryResult(
query):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ query: string
Inherited from
ChaincodeStub.getQueryResult
Source
node_modules/fabric-shim/types/index.d.ts:119
getQueryResultWithPagination()
getQueryResultWithPagination(
query,pageSize,bookmark?):Promise\<StateQueryResponse\<StateQueryIterator>> &AsyncIterable\<KV>
Parameters
▪ query: string
▪ pageSize: number
▪ bookmark?: string
Inherited from
ChaincodeStub.getQueryResultWithPagination
Source
node_modules/fabric-shim/types/index.d.ts:120
getSignedProposal()
getSignedProposal():
SignedProposal
Inherited from
ChaincodeStub.getSignedProposal
Source
node_modules/fabric-shim/types/index.d.ts:104
getStateByPartialCompositeKeyWithPagination()
getStateByPartialCompositeKeyWithPagination(
indexKey,keyParts):Promise\<StateQueryResponse\<StateQueryIterator>> &AsyncIterable\<KV>
Parameters
▪ indexKey: string
▪ keyParts: string[]
Overrides
ChaincodeStub.getStateByPartialCompositeKeyWithPagination
Source
chain-test/src/unit/TestChaincodeStub.ts:153
getStateByRange()
getStateByRange(
start,end):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ start: string
▪ end: string
Overrides
ChaincodeStub.getStateByRange
Source
chain-test/src/unit/TestChaincodeStub.ts:182
getStateByRangeWithPagination()
getStateByRangeWithPagination(
startKey,endKey,pageSize,bookmark?):Promise\<StateQueryResponse\<StateQueryIterator>> &AsyncIterable\<KV>
Parameters
▪ startKey: string
▪ endKey: string
▪ pageSize: number
▪ bookmark?: string
Inherited from
ChaincodeStub.getStateByRangeWithPagination
Source
node_modules/fabric-shim/types/index.d.ts:115
getStateValidationParameter()
getStateValidationParameter(
key):Promise\<Uint8Array>
Parameters
▪ key: string
Inherited from
ChaincodeStub.getStateValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:113
getStringArgs()
getStringArgs():
string[]
Inherited from
ChaincodeStub.getStringArgs
Source
node_modules/fabric-shim/types/index.d.ts:95
getTransient()
getTransient():
Map\<string,Uint8Array>
Inherited from
ChaincodeStub.getTransient
Source
node_modules/fabric-shim/types/index.d.ts:102
getTxID()
getTxID():
string
Inherited from
ChaincodeStub.getTxID
Source
node_modules/fabric-shim/types/index.d.ts:98
getTxTimestamp()
getTxTimestamp():
Timestamp
Inherited from
ChaincodeStub.getTxTimestamp
Source
node_modules/fabric-shim/types/index.d.ts:105
invokeChaincode()
invokeChaincode(
chaincodeName,args,channel):Promise\<ChaincodeResponse>
Parameters
▪ chaincodeName: string
▪ args: string[]
▪ channel: string
Inherited from
ChaincodeStub.invokeChaincode
Source
node_modules/fabric-shim/types/index.d.ts:123
mockState()
mockState(
key,value):void
Parameters
▪ key: string
▪ value: string
Source
chain-test/src/unit/TestChaincodeStub.ts:117
purgePrivateData()
purgePrivateData(
collection,key):Promise\<void>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.purgePrivateData
Source
node_modules/fabric-shim/types/index.d.ts:133
putPrivateData()
putPrivateData(
collection,key,value):Promise\<void>
Parameters
▪ collection: string
▪ key: string
▪ value: Uint8Array
Inherited from
ChaincodeStub.putPrivateData
Source
node_modules/fabric-shim/types/index.d.ts:131
setEvent()
setEvent(
name,payload):void
Parameters
▪ name: string
▪ payload: Uint8Array
Inherited from
ChaincodeStub.setEvent
Source
node_modules/fabric-shim/types/index.d.ts:124
setPrivateDataValidationParameter()
setPrivateDataValidationParameter(
collection,key,ep):Promise\<void>
Parameters
▪ collection: string
▪ key: string
▪ ep: Uint8Array
Inherited from
ChaincodeStub.setPrivateDataValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:134
setStateValidationParameter()
setStateValidationParameter(
key,ep):Promise\<void>
Parameters
▪ key: string
▪ ep: Uint8Array
Inherited from
ChaincodeStub.setStateValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:112
splitCompositeKey()
splitCompositeKey(
compositeKey):SplitCompositekey
Parameters
▪ compositeKey: string
Inherited from
ChaincodeStub.splitCompositeKey
Source
node_modules/fabric-shim/types/index.d.ts:127
createCompositeKey()
staticcreateCompositeKey(objectType,attributes):string
Parameters
▪ objectType: string
▪ attributes: string[]
Inherited from
ChaincodeStub.createCompositeKey
Source
chain-test/src/unit/TestChaincodeStub.ts:27
deletePrivateData()
staticdeletePrivateData(collection,key):Promise\<void>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.deletePrivateData
Source
node_modules/fabric-shim/types/index.d.ts:132
deleteState()
staticdeleteState(key):Promise\<void>
Parameters
▪ key: string
Inherited from
ChaincodeStub.deleteState
Source
node_modules/fabric-shim/types/index.d.ts:111
getArgs()
staticgetArgs():string[]
Inherited from
ChaincodeStub.getArgs
Source
node_modules/fabric-shim/types/index.d.ts:94
getBinding()
staticgetBinding():string
Inherited from
ChaincodeStub.getBinding
Source
node_modules/fabric-shim/types/index.d.ts:107
getChannelID()
staticgetChannelID():string
Inherited from
ChaincodeStub.getChannelID
Source
node_modules/fabric-shim/types/index.d.ts:99
getCreator()
staticgetCreator():SerializedIdentity
Inherited from
ChaincodeStub.getCreator
Source
node_modules/fabric-shim/types/index.d.ts:100
getDateTimestamp()
staticgetDateTimestamp():Date
Inherited from
ChaincodeStub.getDateTimestamp
Source
node_modules/fabric-shim/types/index.d.ts:106
getFunctionAndParameters()
staticgetFunctionAndParameters():object
Returns
fcn
fcn:
stringparams
params:
string[]
Inherited from
ChaincodeStub.getFunctionAndParameters
Source
node_modules/fabric-shim/types/index.d.ts:96
getHistoryForKey()
staticgetHistoryForKey(key):Promise\<HistoryQueryIterator> &AsyncIterable\<KeyModification>
Parameters
▪ key: string
Inherited from
ChaincodeStub.getHistoryForKey
Source
node_modules/fabric-shim/types/index.d.ts:121
getMspID()
staticgetMspID():string
Inherited from
ChaincodeStub.getMspID
Source
node_modules/fabric-shim/types/index.d.ts:101
getPrivateData()
staticgetPrivateData(collection,key):Promise\<Uint8Array>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.getPrivateData
Source
node_modules/fabric-shim/types/index.d.ts:129
getPrivateDataByPartialCompositeKey()
staticgetPrivateDataByPartialCompositeKey(collection,objectType,attributes):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ collection: string
▪ objectType: string
▪ attributes: string[]
Inherited from
ChaincodeStub.getPrivateDataByPartialCompositeKey
Source
node_modules/fabric-shim/types/index.d.ts:137
getPrivateDataByRange()
staticgetPrivateDataByRange(collection,startKey,endKey):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ collection: string
▪ startKey: string
▪ endKey: string
Inherited from
ChaincodeStub.getPrivateDataByRange
Source
node_modules/fabric-shim/types/index.d.ts:136
getPrivateDataHash()
staticgetPrivateDataHash(collection,key):Promise\<Uint8Array>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.getPrivateDataHash
Source
node_modules/fabric-shim/types/index.d.ts:130
getPrivateDataQueryResult()
staticgetPrivateDataQueryResult(collection,query):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ collection: string
▪ query: string
Inherited from
ChaincodeStub.getPrivateDataQueryResult
Source
node_modules/fabric-shim/types/index.d.ts:138
getPrivateDataValidationParameter()
staticgetPrivateDataValidationParameter(collection,key):Promise\<Uint8Array>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.getPrivateDataValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:135
getQueryResult()
staticgetQueryResult(query):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ query: string
Inherited from
ChaincodeStub.getQueryResult
Source
node_modules/fabric-shim/types/index.d.ts:119
getQueryResultWithPagination()
staticgetQueryResultWithPagination(query,pageSize,bookmark?):Promise\<StateQueryResponse\<StateQueryIterator>> &AsyncIterable\<KV>
Parameters
▪ query: string
▪ pageSize: number
▪ bookmark?: string
Inherited from
ChaincodeStub.getQueryResultWithPagination
Source
node_modules/fabric-shim/types/index.d.ts:120
getSignedProposal()
staticgetSignedProposal():SignedProposal
Inherited from
ChaincodeStub.getSignedProposal
Source
node_modules/fabric-shim/types/index.d.ts:104
getState()
staticgetState(key):Promise\<Uint8Array>
Parameters
▪ key: string
Inherited from
ChaincodeStub.getState
Source
node_modules/fabric-shim/types/index.d.ts:109
getStateByPartialCompositeKey()
staticgetStateByPartialCompositeKey(objectType,attributes):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ objectType: string
▪ attributes: string[]
Inherited from
ChaincodeStub.getStateByPartialCompositeKey
Source
node_modules/fabric-shim/types/index.d.ts:116
getStateByPartialCompositeKeyWithPagination()
staticgetStateByPartialCompositeKeyWithPagination(objectType,attributes,pageSize,bookmark?):Promise\<StateQueryResponse\<StateQueryIterator>> &AsyncIterable\<KV>
Parameters
▪ objectType: string
▪ attributes: string[]
▪ pageSize: number
▪ bookmark?: string
Inherited from
ChaincodeStub.getStateByPartialCompositeKeyWithPagination
Source
node_modules/fabric-shim/types/index.d.ts:117
getStateByRange()
staticgetStateByRange(startKey,endKey):Promise\<StateQueryIterator> &AsyncIterable\<KV>
Parameters
▪ startKey: string
▪ endKey: string
Inherited from
ChaincodeStub.getStateByRange
Source
node_modules/fabric-shim/types/index.d.ts:114
getStateByRangeWithPagination()
staticgetStateByRangeWithPagination(startKey,endKey,pageSize,bookmark?):Promise\<StateQueryResponse\<StateQueryIterator>> &AsyncIterable\<KV>
Parameters
▪ startKey: string
▪ endKey: string
▪ pageSize: number
▪ bookmark?: string
Inherited from
ChaincodeStub.getStateByRangeWithPagination
Source
node_modules/fabric-shim/types/index.d.ts:115
getStateValidationParameter()
staticgetStateValidationParameter(key):Promise\<Uint8Array>
Parameters
▪ key: string
Inherited from
ChaincodeStub.getStateValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:113
getStringArgs()
staticgetStringArgs():string[]
Inherited from
ChaincodeStub.getStringArgs
Source
node_modules/fabric-shim/types/index.d.ts:95
getTransient()
staticgetTransient():Map\<string,Uint8Array>
Inherited from
ChaincodeStub.getTransient
Source
node_modules/fabric-shim/types/index.d.ts:102
getTxID()
staticgetTxID():string
Inherited from
ChaincodeStub.getTxID
Source
node_modules/fabric-shim/types/index.d.ts:98
getTxTimestamp()
staticgetTxTimestamp():Timestamp
Inherited from
ChaincodeStub.getTxTimestamp
Source
node_modules/fabric-shim/types/index.d.ts:105
invokeChaincode()
staticinvokeChaincode(chaincodeName,args,channel):Promise\<ChaincodeResponse>
Parameters
▪ chaincodeName: string
▪ args: string[]
▪ channel: string
Inherited from
ChaincodeStub.invokeChaincode
Source
node_modules/fabric-shim/types/index.d.ts:123
purgePrivateData()
staticpurgePrivateData(collection,key):Promise\<void>
Parameters
▪ collection: string
▪ key: string
Inherited from
ChaincodeStub.purgePrivateData
Source
node_modules/fabric-shim/types/index.d.ts:133
putPrivateData()
staticputPrivateData(collection,key,value):Promise\<void>
Parameters
▪ collection: string
▪ key: string
▪ value: Uint8Array
Inherited from
ChaincodeStub.putPrivateData
Source
node_modules/fabric-shim/types/index.d.ts:131
putState()
staticputState(key,value):Promise\<void>
Parameters
▪ key: string
▪ value: Uint8Array
Inherited from
ChaincodeStub.putState
Source
node_modules/fabric-shim/types/index.d.ts:110
setEvent()
staticsetEvent(name,payload):void
Parameters
▪ name: string
▪ payload: Uint8Array
Inherited from
ChaincodeStub.setEvent
Source
node_modules/fabric-shim/types/index.d.ts:124
setPrivateDataValidationParameter()
staticsetPrivateDataValidationParameter(collection,key,ep):Promise\<void>
Parameters
▪ collection: string
▪ key: string
▪ ep: Uint8Array
Inherited from
ChaincodeStub.setPrivateDataValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:134
setStateValidationParameter()
staticsetStateValidationParameter(key,ep):Promise\<void>
Parameters
▪ key: string
▪ ep: Uint8Array
Inherited from
ChaincodeStub.setStateValidationParameter
Source
node_modules/fabric-shim/types/index.d.ts:112
splitCompositeKey()
staticsplitCompositeKey(compositeKey):SplitCompositekey
Parameters
▪ compositeKey: string
Inherited from
ChaincodeStub.splitCompositeKey
Source
node_modules/fabric-shim/types/index.d.ts:127