-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusdc.spec.ts
32 lines (28 loc) · 1.36 KB
/
usdc.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { TestUtils } from './TestUtils';
UTest({
async $before () {
await TestUtils.start();
},
async 'should create accounts' () {
var { stdout } = await TestUtils.execute(`npx atma act ./actions/usdc.act.ts -q "create-accounts"`);
has_(stdout, /foo.+0x\w{40}/);
has_(stdout, /bar.+0x\w{40}/);
},
async 'should get current block' () {
let { stdout, stderr } = await TestUtils.execute(`npx 0xweb block get latest --chain hardhat --no-color`);
has_(stdout, /Block.+\d+/);
has_(stdout, /Hash.+0x/);
},
async 'should top up foo account' () {
var { stdout } = await TestUtils.execute(`npx atma act ./actions/usdc.act.ts -q "set-balance"`);
has_(stdout, /50000000000.+wei/);
var { stdout } = await TestUtils.execute(`npx 0xweb account balance foo USDC --config-accounts ./config/accounts.json --pin hello --chain hardhat`);
has_(stdout, /Balance.+50000\b/)
},
async 'should transfer to bar account' () {
var { stdout } = await TestUtils.execute(`npx atma act ./actions/usdc.act.ts -q "transfer-balance"`);
has_(stdout, /Send 50000000000 usdc/);
var { stdout } = await TestUtils.execute(`npx 0xweb account balance bar USDC --config-accounts ./config/accounts.json --pin hello --chain hardhat`);
has_(stdout, /Balance.+50000\b/)
}
});