Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
codchen committed May 17, 2024
1 parent 9f6dc4b commit e812354
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/test/CW20toERC20PointerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions contracts/test/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e812354

Please sign in to comment.