From 6fc370d65395e87fc27937f0d86214f28dfc3195 Mon Sep 17 00:00:00 2001 From: oXtxNt9U <120286271+oXtxNt9U@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:34:31 +0900 Subject: [PATCH] fix --- .../evm-service/source/instances/evm.test.ts | 28 +++++++++---------- packages/evm/bindings/src/lib.rs | 1 - 2 files changed, 14 insertions(+), 15 deletions(-) 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 {