Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
2861d92a
Commit
2861d92a
authored
Jun 11, 2023
by
Ratimon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting for resource metering
parent
9a824b55
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
ResourceMetering.t.sol
...-bedrock/contracts/test/invariants/ResourceMetering.t.sol
+8
-9
No files found.
packages/contracts-bedrock/contracts/test/invariants/ResourceMetering.t.sol
View file @
2861d92a
...
...
@@ -4,7 +4,7 @@ pragma solidity 0.8.15;
import { Test } from "forge-std/Test.sol";
import { StdUtils } from "forge-std/StdUtils.sol";
import {
StdInvariant
} from "forge-std/StdInvariant.sol";
import {
StdInvariant
} from "forge-std/StdInvariant.sol";
import { Arithmetic } from "../../libraries/Arithmetic.sol";
import { ResourceMetering } from "../../L1/ResourceMetering.sol";
...
...
@@ -12,7 +12,6 @@ import { Proxy } from "../../universal/Proxy.sol";
import { Constants } from "../../libraries/Constants.sol";
contract ResourceMetering_User is StdUtils, ResourceMetering {
bool public failedMaxGasPerBlock;
bool public failedRaiseBaseFee;
bool public failedLowerBaseFee;
...
...
@@ -45,11 +44,13 @@ contract ResourceMetering_User is StdUtils, ResourceMetering {
ResourceMetering.ResourceConfig memory rcfg = Constants.DEFAULT_RESOURCE_CONFIG();
return rcfg;
}
/**
* @notice Takes the necessary parameters to allow us to burn arbitrary amounts of gas to test
* the underlying resource metering/gas market logic
*/
function burn(uint256 _gasToBurn, bool _raiseBaseFee) public { // Part 1: we cache the current param values and do some basic checks on them.
function burn(uint256 _gasToBurn, bool _raiseBaseFee) public {
// Part 1: we cache the current param values and do some basic checks on them.
uint256 cachedPrevBaseFee = uint256(params.prevBaseFee);
uint256 cachedPrevBoughtGas = uint256(params.prevBoughtGas);
uint256 cachedPrevBlockNum = uint256(params.prevBlockNum);
...
...
@@ -151,7 +152,6 @@ contract ResourceMetering_User is StdUtils, ResourceMetering {
}
function _burnInternal(uint64 _gasToBurn) private metered(_gasToBurn) {}
}
contract ResourceMetering_Invariant is StdInvariant, Test {
...
...
@@ -245,4 +245,3 @@ contract ResourceMetering_Invariant is StdInvariant, Test {
assertFalse(actor.underflow());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment