Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oXtxNt9U committed Dec 20, 2024
1 parent 701533f commit 6fc370d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
28 changes: 14 additions & 14 deletions packages/evm-service/source/instances/evm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,20 +515,20 @@ describe<{
it("should revert transaction if it exceeds gas limit", async ({ instance }) => {
const [sender] = wallets;

const commitKey = { height: BigInt(0), round: BigInt(0) };
const { receipt } = await instance.process({
caller: sender.address,
value: 0n,
nonce: 0n,
data: Buffer.from(MainsailERC20.bytecode.slice(2), "hex"),
blockContext: { ...blockContext, commitKey },
txHash: getRandomTxHash(),
gasLimit: 30_000n,
specId: Contracts.Evm.SpecId.SHANGHAI,
});

assert.false(receipt.success);
assert.equal(receipt.gasUsed, 30_000n);
await assert.rejects(
async () =>
instance.process({
caller: sender.address,
value: 0n,
nonce: 0n,
data: Buffer.from(MainsailERC20.bytecode.slice(2), "hex"),
blockContext: { ...blockContext, commitKey: { height: BigInt(0), round: BigInt(0) } },
txHash: getRandomTxHash(),
gasLimit: 30_000n,
specId: Contracts.Evm.SpecId.SHANGHAI,
}),
"transaction validation error: call gas cost exceeds the gas limit",
);
});

it("should reject invalid specId", async ({ instance }) => {
Expand Down
1 change: 0 additions & 1 deletion packages/evm/bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ impl EvmInner {
assert!(pending.key == commit_key, "pending commit key mismatch");
}

let gas_limit = tx_ctx.gas_limit;
let result = self.transact_evm(tx_ctx.into());

match result {
Expand Down

0 comments on commit 6fc370d

Please sign in to comment.