From e8123547983ae42f41ae273f5ed7997147db134b Mon Sep 17 00:00:00 2001 From: codchen Date: Fri, 17 May 2024 17:09:13 +0800 Subject: [PATCH] fix test --- contracts/test/CW20toERC20PointerTest.js | 1 + contracts/test/lib.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/contracts/test/CW20toERC20PointerTest.js b/contracts/test/CW20toERC20PointerTest.js index 123c5b674a..a74f503718 100644 --- a/contracts/test/CW20toERC20PointerTest.js +++ b/contracts/test/CW20toERC20PointerTest.js @@ -102,6 +102,7 @@ describe("CW20 to ERC20 Pointer", function () { }); it("transfer to contract address should succeed", async function() { + await associateWasm(cw20Pointer); const respBefore = await queryWasm(cw20Pointer, "balance", {address: admin.seiAddress}) const balanceBefore = respBefore.data.balance; diff --git a/contracts/test/lib.js b/contracts/test/lib.js index 2b078817eb..82f7ba6487 100644 --- a/contracts/test/lib.js +++ b/contracts/test/lib.js @@ -349,6 +349,12 @@ async function executeWasm(contractAddress, msg, coins = "0usei") { return JSON.parse(output); } +async function associateWasm(contractAddress) { + const command = `seid tx evm associate-contract-address ${contractAddress} --from ${adminKeyName} --gas=5000000 --fees=1000000usei -y --broadcast-mode block -o json`; + const output = await execute(command); + return JSON.parse(output); +} + async function isDocker() { return new Promise((resolve, reject) => { exec("docker ps --filter 'name=sei-node-0' --format '{{.Names}}'", (error, stdout, stderr) => {