Skip to content
This repository has been archived by the owner on Mar 11, 2023. It is now read-only.

Commit

Permalink
[Project] Rollback ethersjs to 5.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
UnsignedInt8 committed Nov 10, 2021
1 parent 750c53d commit b51c316
Show file tree
Hide file tree
Showing 4 changed files with 416 additions and 145 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"delay": "^5.0.0",
"eth-sig-util": "^3.0.1",
"eth-url-parser": "^1.0.4",
"ethers": "^5.5.1",
"ethers": "5.4.7",
"feather-icons": "^4.28.0",
"feather-icons-react": "^0.5.0",
"got": "^11.8.2",
Expand Down
20 changes: 10 additions & 10 deletions src/backend/lib/WalletConnect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ERC20ABI from '../../abis/ERC20.json';
import { ethers } from 'ethers';
import { getProviderByChainId } from '../../common/Provider';

const provider = getProviderByChainId(1);
// const provider = getProviderByChainId(1);

test('decode function', () => {
const data =
Expand All @@ -15,16 +15,16 @@ test('decode function', () => {
expect(wad.toString()).toBe('120240243749853277585');
});

test('contract call', async () => {
const c = new ethers.Contract('0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', ERC20ABI, provider);
expect(await c.decimals()).toBe(18);
expect(await c.symbol()).toBe('UNI');
});
// test('contract call', async () => {
// const c = new ethers.Contract('0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', ERC20ABI, provider);
// expect(await c.decimals()).toBe(18);
// expect(await c.symbol()).toBe('UNI');
// });

test('getBalance', async () => {
const balance = await provider.getBalance('0x3afd8a3ffD64712F523Af8788763EE0C718614A2');
expect(balance.gte(0)).toBe(true);
});
// test('getBalance', async () => {
// const balance = await provider.getBalance('0x3afd8a3ffD64712F523Af8788763EE0C718614A2');
// expect(balance.gte(0)).toBe(true);
// });

test('decode approve', () => {
const data =
Expand Down
10 changes: 10 additions & 0 deletions src/common/Mnemonic.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as ethers from 'ethers';

import { langToWordlist } from './Mnemonic';

test('chinese test', () => {
const s = '泰 浸 钉 信 堵 连 掌 仲 司 硬 桥 勾';
const wl = langToWordlist(s);
console.log(wl, wl.getWord(5));
expect(wl).toStrictEqual(ethers.wordlists.zh);
});
Loading

0 comments on commit b51c316

Please sign in to comment.