Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekkMA committed Jan 15, 2025
1 parent 0a8d9b3 commit 362afdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ts-tests/tests/test-contract-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ describeWithFrontier("Frontier RPC (Contract)", (context) => {
const baseCost = 24029;

// going from unset storage to some value (original = 0)
expect(tx1.gasUsed - baseCost).to.be.eq(20000);
expect(tx1.gasUsed - baseCost).to.be.eq(19993);
// in London config, setting back the same value have cost of warm read
expect(tx2.gasUsed - baseCost).to.be.eq(100);
expect(tx2.gasUsed - baseCost).to.be.eq(93);
// - the original storage didn't change in the current transaction
// - the original storage is not zero (otherwise tx1)
expect(tx3.gasUsed - baseCost).to.be.eq(2900);
expect(tx3.gasUsed - baseCost).to.be.eq(2893);
});
});
2 changes: 1 addition & 1 deletion ts-tests/tests/test-execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describeWithFrontier("Frontier RPC (RPC execution)", (context) => {
},
]);

expect(result.result).to.be.equal("0x30464");
expect(result.result).to.be.equal("0x2e4b4");
});

step("should estimateGas with gas limit up to 10x block gas limit", async function () {
Expand Down
6 changes: 3 additions & 3 deletions ts-tests/tests/test-gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => {
from: GENESIS_ACCOUNT,
data: Test.bytecode,
});
expect(result).to.equal(197732);
expect(result).to.equal(189620);
});

it("eth_estimateGas should ignore nonce", async function () {
Expand All @@ -138,7 +138,7 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => {
data: Test.bytecode,
nonce: 42, // Arbitrary nonce value
});
expect(result).to.equal(197732);
expect(result).to.equal(189620);
});

it("tx gas limit below ETH_BLOCK_GAS_LIMIT", async function () {
Expand Down Expand Up @@ -420,6 +420,6 @@ describeWithFrontier("Frontier RPC (Invalid opcode estimate gas)", (context) =>
});
// The actual estimated value is irrelevant for this test purposes, we just want to verify that
// the binary search is not interrupted when an InvalidCode is returned by the evm.
expect(estimate).to.equal(85703);
expect(estimate).to.equal(85699);
});
});

0 comments on commit 362afdf

Please sign in to comment.