Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Jul 27, 2023
1 parent 3bf32e3 commit 2f85042
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/axelar-local-dev/src/__tests__/relay.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
'use strict';

import { createNetwork, relay, stopAll, listen, getFee, getDepositAddress, deployContract, setLogger } from '../';
import { createNetwork, relay, stopAll, listen, getFee, getDepositAddress, deployContract, setLogger, evmRelayer } from '../';
import { defaultAbiCoder } from 'ethers/lib/utils';
import { BigNumber, Contract, ContractTransaction, Wallet, ethers } from 'ethers';
import { Network } from '../Network';
Expand All @@ -28,9 +28,11 @@ describe('relay', () => {
[user2] = chain2.userWallets;
chain2.usdc = await chain2.deployToken('Axelar Wrapped USDC', 'aUSDC', 6, BigInt(1e18)).then((c: Contract) => c.connect(user2));
});

afterEach(async () => {
await stopAll();
});

describe('deposit address', () => {
it('should generate a deposit address', async () => {
const depositAddress = await getDepositAddress(chain1, chain2, user2.address, 'aUSDC');
Expand Down Expand Up @@ -260,7 +262,7 @@ describe('relay', () => {
const contract2 = await deployContract(user2, ExpressWithToken, [chain2.gateway.address, chain2.gasService.address]);

// subscribe to the express call
await chain1.relayer?.subscribeExpressCall();
await evmRelayer.subscribeExpressCall();

// mint usdc tokens to user1
await chain1.giveToken(user1.address, 'aUSDC', BigInt(amount));
Expand All @@ -274,7 +276,7 @@ describe('relay', () => {
.then((tx: ContractTransaction) => tx.wait());

await new Promise((resolve) => setTimeout(resolve, 5000));
await chain1.relayer?.unsubscribe();
await evmRelayer.unsubscribe();

// check that the call was successful
const user2Balance = (await chain2.usdc?.balanceOf(user2.address))?.toNumber();
Expand Down

0 comments on commit 2f85042

Please sign in to comment.