From 76319203216150f2a47d6e8eef01f520626e7c68 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:31:34 +0800 Subject: [PATCH] Update AXON_MAX_GAS_LIMIT in test/Rollback.js --- contracts/test/Rollback.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contracts/test/Rollback.js b/contracts/test/Rollback.js index b5f315b8..611b383d 100644 --- a/contracts/test/Rollback.js +++ b/contracts/test/Rollback.js @@ -142,11 +142,12 @@ describe('RollBack', function () { txData.testWay ); - const MAX_GAS_LIMIT = 50000000 + // https://github.com/axonweb3/axon/blob/0.3.0-alpha.1/protocol/src/constants/configs.rs#L3-L6 + const AXON_MAX_GAS_LIMIT = 30000000 let gasLimit; - if (estimatedGas > MAX_GAS_LIMIT) { - console.error(`Estimated Gas (${estimatedGas.toString()}) exceeds ${MAX_GAS_LIMIT}`); - gasLimit = MAX_GAS_LIMIT; + if (estimatedGas > AXON_MAX_GAS_LIMIT) { + console.error(`Estimated Gas (${estimatedGas.toString()}) exceeds ${AXON_MAX_GAS_LIMIT}`); + gasLimit = AXON_MAX_GAS_LIMIT; } else { gasLimit = estimatedGas; } @@ -163,7 +164,7 @@ describe('RollBack', function () { const receipt = await tx.wait() - if (estimatedGas > MAX_GAS_LIMIT) { + if (estimatedGas > AXON_MAX_GAS_LIMIT) { console.log("changeWithRevert gasUsed: ",receipt.gasUsed.toString()) }