Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Oct 23, 2024
1 parent f5f7d87 commit 9ed186f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
19 changes: 9 additions & 10 deletions src/__tests__/bootstrap.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ADDRESSES, ROUTER_TOKEN_INFO } from '@acala-network/asset-router/dist/consts';
import { AcalaJsonRpcProvider } from '@acala-network/eth-providers';
import { ADDRESSES } from '@acala-network/asset-router/dist/consts';
import { ApiPromise, WsProvider } from '@polkadot/api';
import { ERC20__factory } from '@certusone/wormhole-sdk/lib/cjs/ethers-contracts';
import { FeeRegistry__factory } from '@acala-network/asset-router/dist/typechain-types';
Expand All @@ -10,30 +9,28 @@ import { parseEther, parseUnits } from 'ethers/lib/utils';
import { toHuman } from '@acala-network/asset-router/dist/utils';

import { DropAndBootstrapParams } from '../utils';
import { ETH_RPC, EUPHRATES_ADDR } from '../consts';
import { EUPHRATES_ADDR } from '../consts';
import {
JITOSOL_ADDR,
JITOSOL_DECIMALS,
JITOSOL_LDOT_LP_PREDEPLOY_CODE,
LDOT_DECIMALS,
NEW_DEX_CODE,
TEST_ADDR_RELAYER,
TEST_ADDR_USER,
TEST_KEY,
} from './testConsts';
import {
api,
expectError,
provider,
relayer,
sudoSendAndWait,
sudoTransferToken,
transferToken,
} from './testUtils';

const provider = new AcalaJsonRpcProvider(ETH_RPC.LOCAL);
const relayer = new Wallet(TEST_KEY.RELAYER, provider);
const user = Wallet.createRandom().connect(provider);

const JITOSOL_DECIMALS = 9;
const LDOT_DECIMALS = 10;
const JITOSOL_ADDR = ROUTER_TOKEN_INFO.jitosol.acalaAddr;

const recipient = user.address;
const boostrapAmountJitosol = '0.1';
const boostrapAmountLdot = '10';
Expand Down Expand Up @@ -87,6 +84,8 @@ describe('prepare', () => {
JITOSOL_ADDR,
5,
);

await api.disconnect();
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/configs/acala.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
endpoint:
- wss://acala-rpc.aca-api.network
- wss://acala-rpc.dwellir.com
- wss://acala-rpc.aca-api.network
mock-signature-host: true
# block: ${env.ACALA_BLOCK_NUMBER}
db: ./db.sqlite
Expand Down
14 changes: 5 additions & 9 deletions src/__tests__/euphrates.test.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
import { ADDRESSES } from '@acala-network/asset-router/dist/consts';
import { AcalaJsonRpcProvider } from '@acala-network/eth-providers';
import { DOT, LCDOT_13 as LCDOT, LDOT } from '@acala-network/contracts/utils/AcalaTokens';
import { ERC20__factory } from '@certusone/wormhole-sdk/lib/cjs/ethers-contracts';
import { FeeRegistry__factory } from '@acala-network/asset-router/dist/typechain-types';
import { HOMA } from '@acala-network/contracts/utils/Predeploy';
import { IHoma__factory } from '@acala-network/contracts/typechain';
import { ONE_ACA, almostEq, toHuman } from '@acala-network/asset-router/dist/utils';
import { Wallet } from 'ethers';
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { formatEther, parseEther, parseUnits } from 'ethers/lib/utils';

import { ETH_RPC, EUPHRATES_ADDR, EUPHRATES_POOLS } from '../consts';
import { EUPHRATES_ADDR, EUPHRATES_POOLS } from '../consts';
import { RouteParamsEuphrates } from '../utils';
import {
TEST_ADDR_RELAYER,
TEST_ADDR_USER,
TEST_KEY,
} from './testConsts';
import {
api,
expectError,
provider,
relayer,
transferToken,
user,
} from './testUtils';

const provider = new AcalaJsonRpcProvider(ETH_RPC.LOCAL);
const relayer = new Wallet(TEST_KEY.RELAYER, provider); // 0xe3234f433914d4cfCF846491EC5a7831ab9f0bb3
const user = new Wallet(TEST_KEY.USER, provider); // 0x0085560b24769dAC4ed057F1B2ae40746AA9aAb6

// [inToken, outToken]
const WTDOT = '0xe1bd4306a178f86a9214c39abcd53d021bedb0f9';
const EUPHRAETS_POOL_INFO = {
Expand Down
Loading

0 comments on commit 9ed186f

Please sign in to comment.