Unit Test Clarity Language

17 views Asked by At

I have a question on about Unit Test While I putting some code on Tx.contractCall in the .ts file, what types should I choose if I want to put contract name?

Tx.contractCall(
                ""dex"",
                ""provide-liquidity"",
                [
                    types.principal(deployer).avocado, --> This part....(I already checked it works on console, but don't know how to express in .ts files. 
                    types.uint(10000),
                    types.uint(10000),

                ],
                deployer,
            )

ps. it's console code I checked. (contract-call? .dex provide-liquidity .avocado u100 u100). -> I would like to convert this statement to the above ts Unit testing."

1

There are 1 answers

0
Kenny On

You need to concatenate the contract name, like this:

Like this:
Tx.contractCall(
  "dex",
  "provide-liquidity",
  [
    types.principal(deployer)+".avocado", --> I found  types.principal( deployer.concat(".avocado") )
    types.uint(10000),
    types.uint(10000),
  ],
  deployer,
),