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
7719c853
Unverified
Commit
7719c853
authored
Nov 24, 2024
by
Michael Amadi
Committed by
GitHub
Nov 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes (#13052)
parent
44367b02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
L1ChugSplashProxy.t.sol
...ges/contracts-bedrock/test/legacy/L1ChugSplashProxy.t.sol
+21
-1
No files found.
packages/contracts-bedrock/test/legacy/L1ChugSplashProxy.t.sol
View file @
7719c853
...
@@ -3,6 +3,7 @@ pragma solidity 0.8.15;
...
@@ -3,6 +3,7 @@ pragma solidity 0.8.15;
// Testing utilities
// Testing utilities
import { Test } from "forge-std/Test.sol";
import { Test } from "forge-std/Test.sol";
import { VmSafe } from "forge-std/Vm.sol";
// Target contract
// Target contract
import { IL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol";
import { IL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol";
...
@@ -91,9 +92,28 @@ contract L1ChugSplashProxy_Test is Test {
...
@@ -91,9 +92,28 @@ contract L1ChugSplashProxy_Test is Test {
/// contract's deployment, it reverts.
/// contract's deployment, it reverts.
/// @dev If this solc version/settings change and modifying this proves time consuming, we can just remove it.
/// @dev If this solc version/settings change and modifying this proves time consuming, we can just remove it.
function test_setCode_whenOwnerAndDeployOutOfGas_reverts() public {
function test_setCode_whenOwnerAndDeployOutOfGas_reverts() public {
// The values below are best gotten by removing the gas limit parameter from the call and running the test with
// a
// verbosity of `-vvvv` then setting the value to a few thousand gas lower than the gas used by the call.
// A faster way to do this for forge coverage cases, is to comment out the optimizer and optimizer runs in
// the foundry.toml file and then run forge test. This is faster because forge test only compiles modified
// contracts unlike forge coverage.
uint256 gasLimit;
// Because forge coverage always runs with the optimizer disabled,
// if forge coverage is run before testing this with forge test or forge snapshot, forge clean should be
// run first so that it recompiles the contracts using the foundry.toml optimizer settings.
if (vm.isContext(VmSafe.ForgeContext.Coverage)) {
gasLimit = 95_000;
} else if (vm.isContext(VmSafe.ForgeContext.Test) || vm.isContext(VmSafe.ForgeContext.Snapshot)) {
gasLimit = 65_000;
} else {
revert("SafeCall_Test: unknown context");
}
vm.prank(owner);
vm.prank(owner);
vm.expectRevert(bytes("L1ChugSplashProxy: code was not correctly deployed")); // Ran out of gas
vm.expectRevert(bytes("L1ChugSplashProxy: code was not correctly deployed")); // Ran out of gas
proxy.setCode{ gas:
65_000
}(
proxy.setCode{ gas:
gasLimit
}(
hex"fefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefe"
hex"fefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefe"
);
);
}
}
...
...
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