Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AXON_MAX_GAS_LIMIT in test/Rollback.js #319

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading