Skip to content

Commit

Permalink
Update bodhi version
Browse files Browse the repository at this point in the history
  • Loading branch information
zjb0807 committed Sep 28, 2023
1 parent 81cfc2d commit 004acd4
Show file tree
Hide file tree
Showing 9 changed files with 460 additions and 583 deletions.
14 changes: 7 additions & 7 deletions ts-tests/build/ERC20.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions ts-tests/build/Erc20DemoContract.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions ts-tests/build/Erc20DemoContract2.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ts-tests/build/MockLiquidationContract.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ts-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"run-test": "yarn mocha -r ts-node/register/transpile-only --timeout 50000 --no-warnings"
},
"dependencies": {
"@acala-network/api": "~5.0.3-0",
"@acala-network/bodhi": "~2.6.10",
"@acala-network/api": "~6.0.0",
"@acala-network/bodhi": "~2.7.8",
"@babel/runtime": "^7.21.5",
"@polkadot/api": "^10.5.1",
"@polkadot/api": "^10.9.1",
"@openzeppelin/contracts": "4.9.3",
"@types/chai": "^4.2.22",
"@types/chai-as-promised": "^7.1.4",
"@types/mocha": "^9.0.0",
"chai": "^4.3.4",
"chai": "^4.3.7",
"chai-as-promised": "^7.1.1",
"ethereum-waffle": "3.4.0",
"ethers": "~5.5.0",
"ethers": "~5.7.0",
"mocha": "^9.1.3",
"mocha-steps": "^1.3.0",
"ts-node": "^10.7.0",
Expand Down
6 changes: 3 additions & 3 deletions ts-tests/tests/test-bodhi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ describeWithAcala("Acala RPC (bodhi.js)", (context) => {

step("should get gas price", async function () {
const gasPrice = await context.provider.getGasPrice();
expect(gasPrice.toString()).to.be.equal("200000274442");
expect(gasPrice.toString()).to.be.equal("100000000205");
});

step("should get fee data ", async function () {
const data = await context.provider.getFeeData();

expect(data.gasPrice?.toNumber()).to.be.eq(200000274442);
expect(data.gasPrice?.toNumber()).to.be.eq(100000000205);
});

step("should get transaction count", async function () {
Expand Down Expand Up @@ -83,7 +83,7 @@ describeWithAcala("Acala RPC (bodhi.js)", (context) => {
await contract.populateTransaction.multiply(3)
);

expect(gas.toNumber()).to.be.eq(342409);
expect(gas.toNumber()).to.be.eq(100100);
});

step("should estimateResources", async function () {
Expand Down
6 changes: 3 additions & 3 deletions ts-tests/tests/test-contract-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describeWithAcala("Acala RPC (Contract Methods)", (context) => {
}
], alice);

await expect(mock.multiply()).to.be.rejectedWith('VM Exception while processing transaction: execution revert: 0x');
await expect(mock.multiply()).to.be.rejectedWith('execution reverted: ');
});

// Requires error handling
Expand All @@ -99,7 +99,7 @@ describeWithAcala("Acala RPC (Contract Methods)", (context) => {
}
], alice);

await expect(mock.multiply(3, 4)).to.be.rejectedWith('VM Exception while processing transaction: execution revert: 0x');
await expect(mock.multiply(3, 4)).to.be.rejectedWith('execution reverted: ');
});

// Requires error handling
Expand All @@ -113,6 +113,6 @@ describeWithAcala("Acala RPC (Contract Methods)", (context) => {
}
], alice);

await expect(mock.multiply("0x0123456789012345678901234567890123456789")).to.be.rejectedWith('VM Exception while processing transaction: execution revert: 0x');
await expect(mock.multiply("0x0123456789012345678901234567890123456789")).to.be.rejectedWith('execution reverted: ');
});
});
4 changes: 2 additions & 2 deletions ts-tests/tests/test-gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describeWithAcala("Acala RPC (Gas)", (context) => {
from: alice.getAddress(),
data: "0x" + Block.bytecode,
});
expect(gas.toNumber()).to.be.eq(593373);
expect(gas.toNumber()).to.be.eq(11301014);
});

it("eth_estimateResources for contract creation", async function () {
Expand All @@ -35,7 +35,7 @@ describeWithAcala("Acala RPC (Gas)", (context) => {
it("eth_estimateGas for contract call", async function () {
const contract = await deployContract(alice, Block);
const gas = await contract.estimateGas.multiply(3);
expect(gas.toNumber()).to.be.eq(342409);
expect(gas.toNumber()).to.be.eq(100100);
});

it("eth_estimateResources for contract call", async function () {
Expand Down
965 changes: 421 additions & 544 deletions ts-tests/yarn.lock

Large diffs are not rendered by default.

0 comments on commit 004acd4

Please sign in to comment.