Skip to content

@gala-chain/testAPI


API > TestChaincode

Class: TestChaincode

Contents

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

readonly callHistory: 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

private readonly chaincode: ChaincodeFromContractClassType

Source

chain-test/src/unit/TestChaincode.ts:50


state

readonly state: Record\<string, string> = {}

Source

chain-test/src/unit/TestChaincode.ts:54


writes

readonly writes: 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

Source

chain-test/src/unit/TestChaincode.ts:98