Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,4 @@ jobs:
- name: Run ts tests
run: |
npm install -g yarn
# TODO: update bodhi & enable this
# make test-ts
make test-ts
8 changes: 4 additions & 4 deletions ts-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"build": "waffle waffle.json"
},
"dependencies": {
"@acala-network/api": "6.1.3",
"@acala-network/bodhi": "~2.8.9",
"@acala-network/chopsticks": "^0.13.3",
"@acala-network/api": "6.3.0",
"@acala-network/bodhi": "~2.10.0",
"@acala-network/chopsticks": "^1.2.2",
"@openzeppelin/contracts": "5.0.2",
"@polkadot/api": "12.4.1",
"@polkadot/api": "16.4.8",
"ethereum-waffle": "4.0.10",
"ethers": "5.7.2",
"vitest": "^2.0.5"
Expand Down
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,21 +11,21 @@ describeWithAcala("Acala RPC (Balance)", (context) => {
});

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

expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString())
.to.equal((await context.provider.api.query.system.account(alice.substrateAddress)).data.free.toString() + "000000");
});

it("balance to be updated after transfer", async function () {
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999995648303331000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000995648309012000000");
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999995072568421000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000995072575531000000");

await transfer(context, alice.substrateAddress, alice_stash.substrateAddress, 1000);
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999991609227300000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000995648310012000000");
expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString()).to.equal("8999999991609227300000000");
expect((await context.provider.getBalance(alice.getAddress())).toString()).to.equal("8999999990446773722000000");
expect((await context.provider.getBalance(alice_stash.getAddress())).toString()).to.equal("10100000995072576531000000");
expect((await context.provider.getBalance(alice.getAddress(), "latest")).toString()).to.equal("8999999990446773722000000");
expect((await context.provider.getBalance(alice_stash.getAddress(), "earliest")).toString()).to.equal("0");
});
});
2 changes: 1 addition & 1 deletion ts-tests/tests/test-evm-create-fill-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ describeWithAcala("Acala RPC (EVM create fill block)", (context) => {

const evmCreateEvents = events.events.filter((item) => context.provider.api.events.evm.Created.is(item.event));

expect(evmCreateEvents.length).to.equal(225);
expect(evmCreateEvents.length).to.equal(216);
});
});
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, Factory);
// limited by used_storage
const result = await contract.createContractLoop(350);
expect(result.gasLimit.toNumber()).toMatchInlineSnapshot(`3928498122`);
expect(result.gasLimit.toNumber()).toMatchInlineSnapshot(`3928198122`);

const result2 = await contract.incrementLoop(8130);
expect(result2.gasLimit.toNumber()).toMatchInlineSnapshot(`32506508`);
expect(result2.gasLimit.toNumber()).toMatchInlineSnapshot(`32206508`);

const storages = await context.provider.api.query.evm.accountStorages.entries(contract.address);
// 350 array items
Expand Down
8 changes: 4 additions & 4 deletions ts-tests/tests/test-mempool-priority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ describeWithAcala("Acala RPC (Mempool Priority Order)", (context) => {

const operationalTransactionvalidity = await context.provider.api.call.taggedTransactionQueue.validateTransaction(
"Local",
tx3.toHex(),
tx3.toU8a(),
parentHash
);

expect(operationalTransactionvalidity).toMatchInlineSnapshot(`
{
"ok": {
"longevity": 31,
"priority": "0x0119dfa51d01f600",
"priority": "0x010543655f7f0900",
"propagate": true,
"provides": [
"0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d03000000",
Expand All @@ -96,7 +96,7 @@ describeWithAcala("Acala RPC (Mempool Priority Order)", (context) => {
await tx4.signAsync(alice.substrateAddress, { nonce: nonce + 2 });
const normalTransactionvalidity = await context.provider.api.call.taggedTransactionQueue.validateTransaction(
"Local",
tx4.toHex(),
tx4.toU8a(),
parentHash
);
expect(normalTransactionvalidity.toHuman()).toMatchInlineSnapshot(`
Expand All @@ -120,7 +120,7 @@ describeWithAcala("Acala RPC (Mempool Priority Order)", (context) => {
);
const unsignedTransactionvalidity = await context.provider.api.call.taggedTransactionQueue.validateTransaction(
"Local",
tx5.toHex(),
tx5.toU8a(),
parentHash
);

Expand Down
2 changes: 1 addition & 1 deletion ts-tests/tests/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function startAcalaNode(sealing = true, autoClaim = true): Promise<
'runtime-log-level': 0,
});

const { provider, wallets } = await getTestUtils(`ws://127.0.0.1:${server.listenPort}`, autoClaim);
const { provider, wallets } = await getTestUtils(`ws://${server.addr}`, autoClaim);

if (!sealing) {
server.chain.txPool.mode = BuildBlockMode.Manual;
Expand Down
Loading
Loading