Skip to content

Commit

Permalink
contracts/test/gas: Workaround for flaky gas cost
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Oct 23, 2024
1 parent fdffb27 commit c16165d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/test/gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ describe('Gas Padding', function () {

// Note: calldata isn't included in gas padding
// Thus when the value is 0 it will use 4 gas instead of 16 gas
// TODO: Workaround for flaky gas used https://github.com/oasisprotocol/sapphire-paratime/issues/337.
tx = await contract.testConstantTime(0, 100000);
receipt = await tx.wait();
expect(receipt?.cumulativeGasUsed).eq(initialGasUsed - 12n);
expect(receipt?.cumulativeGasUsed)
.gte(initialGasUsed - 13n)
.lte(initialGasUsed - 12n);
});
});

0 comments on commit c16165d

Please sign in to comment.