diff --git a/packages/evm-service/source/instances/evm.test.ts b/packages/evm-service/source/instances/evm.test.ts index 59e2f5969..0bcaaa94d 100644 --- a/packages/evm-service/source/instances/evm.test.ts +++ b/packages/evm-service/source/instances/evm.test.ts @@ -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 }) => { diff --git a/packages/evm/bindings/src/lib.rs b/packages/evm/bindings/src/lib.rs index 7ee1c2d07..4cd692ad5 100644 --- a/packages/evm/bindings/src/lib.rs +++ b/packages/evm/bindings/src/lib.rs @@ -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 {