@gala-chain/test ∙ API
API > TestChaincode
Class: TestChaincode
Contents
- Constructors
- new TestChaincode(contracts, state, writes, callingUser, callingUserMsp, callHistory)
- Properties
- callHistory
- callingUser
- callingUserMsp
- chaincode
- state
- writes
- Methods
- getContractInstance()
- invoke()
- query()
- setCallingUser()
- setCallingUserMsp()
Constructors
new TestChaincode(contracts, state, writes, callingUser, callingUserMsp, callHistory)
new TestChaincode(
contracts,state,writes,callingUser,callingUserMsp,callHistory):TestChaincode
Parameters
▪ contracts: ClassConstructor\<Contract>[]
▪ state: Record\<string, string>= {}
▪ writes: Record\<string, string>= {}
▪ callingUser: string= "client|admin"
▪ callingUserMsp: string= "CuratorOrg"
▪ callHistory: unknown[]= []
Source
chain-test/src/unit/TestChaincode.ts:52
Properties
callHistory
readonlycallHistory:unknown[] =[]
Source
chain-test/src/unit/TestChaincode.ts:58
callingUser
callingUser:
string="client|admin"
Source
chain-test/src/unit/TestChaincode.ts:56
callingUserMsp
callingUserMsp:
string="CuratorOrg"
Source
chain-test/src/unit/TestChaincode.ts:57
chaincode
privatereadonlychaincode:ChaincodeFromContractClassType
Source
chain-test/src/unit/TestChaincode.ts:50
state
readonlystate:Record\<string,string> ={}
Source
chain-test/src/unit/TestChaincode.ts:54
writes
readonlywrites:Record\<string,string> ={}
Source
chain-test/src/unit/TestChaincode.ts:55
Methods
getContractInstance()
getContractInstance\<
T>(contractClass):T
Type parameters
▪ T extends Contract
Parameters
▪ contractClass: (...args) => T & Function
Source
chain-test/src/unit/TestChaincode.ts:140
invoke()
invoke\<
T>(method, ...args):Promise\<T>
Type parameters
▪ T = InvokeResponse
Parameters
▪ method: string
▪ ...args: (string | object)[]
Source
chain-test/src/unit/TestChaincode.ts:103
query()
query\<
T>(method, ...args):Promise\<T>
Type parameters
▪ T = InvokeResponse
Parameters
▪ method: string
▪ ...args: (string | object)[]
Source
chain-test/src/unit/TestChaincode.ts:121
setCallingUser()
setCallingUser(
user):TestChaincode
Parameters
▪ user: string
Source
chain-test/src/unit/TestChaincode.ts:93
setCallingUserMsp()
setCallingUserMsp(
msp):TestChaincode
Parameters
▪ msp: string