Skip to content

Commit

Permalink
Update AXON_MAX_GAS_LIMIT in test/Rollback.js (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flouse authored Dec 8, 2023
1 parent f16564b commit 4a0dffe
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions contracts/test/Rollback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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())
}

Expand Down

0 comments on commit 4a0dffe

Please sign in to comment.