Skip to content
Prev Previous commit
Next Next commit
fix ts-tests
  • Loading branch information
zqhxuyuan committed Jun 8, 2022
commit ec6eddc322d91c445c361c7d85fb59472ef210f8
14 changes: 7 additions & 7 deletions ts-tests/tests/test-balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ describeWithAcala("Acala RPC (Balance)", (context) => {
});

step("genesis balance is setup correctly", async function () {
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999986402744000000000");
expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString()).to.equal("8999999986402744000000000");
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999985535771315000000");
expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString()).to.equal("8999999985535771315000000");

expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString())
.to.equal((await context.provider.api.query.system.account(await alice.getSubstrateAddress())).data.free.toString() + "000000");
Expand All @@ -21,13 +21,13 @@ describeWithAcala("Acala RPC (Balance)", (context) => {
step("balance to be updated after transfer", async function () {
this.timeout(15000);

expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999986402744000000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000986402748724000000");
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999985535771315000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000985535778201000000");

await transfer(context, await alice.getSubstrateAddress(), await alice_stash.getSubstrateAddress(), 1000);
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999969929155684000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000986402749724000000");
expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString()).to.equal("8999999969929155684000000");
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999968467638103000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000985535779201000000");
expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString()).to.equal("8999999968467638103000000");
expect((await context.provider.getBalance(alice_stash.getAddress(), "earliest")).toString()).to.equal("0");
});
});
2 changes: 1 addition & 1 deletion ts-tests/tests/test-bodhi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ describeWithAcala("Acala RPC (bodhi.js)", (context) => {

expect(data.gas.toNumber()).to.be.eq(22409);
expect(data.storage.toNumber()).to.be.eq(0);
expect(data.weightFee.toNumber()).to.be.eq(3999950550763);
expect(data.weightFee.toNumber()).to.be.eq(5827773367233);
});
});
4 changes: 2 additions & 2 deletions ts-tests/tests/test-gas-limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ describeWithAcala("Acala RPC (GasLimit)", (context) => {
const contract = await deployContract(alice as any, Factory);
// limited by used_storage
const result = await contract.createContractLoop(360);
expect(result.gasLimit.toNumber()).to.be.eq(30_721_769);
expect(result.gasLimit.toNumber()).to.be.eq(30725309);

const result2 = await contract.incrementLoop(9_500);
expect(result2.gasLimit.toNumber()).to.be.eq(32_799_219);
expect(result2.gasLimit.toNumber()).to.be.eq(32803507);

const storages = await context.provider.api.query.evm.accountStorages.entries(contract.address);
// 360 array items
Expand Down
4 changes: 2 additions & 2 deletions ts-tests/tests/test-gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describeWithAcala("Acala RPC (Gas)", (context) => {

expect(data.gas.toNumber()).to.be.eq(273373);
expect(data.storage.toNumber()).to.be.eq(10921);
expect(data.weightFee.toNumber()).to.be.eq(3999960165755);
expect(data.weightFee.toNumber()).to.be.eq(5827787382433);
});

it("eth_estimateGas for contract call", async function () {
Expand All @@ -47,6 +47,6 @@ describeWithAcala("Acala RPC (Gas)", (context) => {

expect(data.gas.toNumber()).to.be.eq(22409);
expect(data.storage.toNumber()).to.be.eq(0);
expect(data.weightFee.toNumber()).to.be.eq(3999940935794);
expect(data.weightFee.toNumber()).to.be.eq(5827759352067);
});
});