-
Notifications
You must be signed in to change notification settings - Fork 0
tests: add solver delegate coverage #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
cf9c6c6
tests: wip
igorroncevic 0f099e3
better tests
igorroncevic 3f02a52
unit tests
igorroncevic 4d3ca32
refactor
igorroncevic c0e4aa2
integration tests
igorroncevic 7e00d57
fork tests
igorroncevic 6dd4735
check snapshots in CI
igorroncevic 6014b9e
add other networks
igorroncevic d5f4220
more precise snapshot
igorroncevic 7377c12
test: address PR review comments
igorroncevic d0db7b4
add rpc urls to env
igorroncevic 626efad
fix tests
igorroncevic 387ef92
simplify tests
igorroncevic 7582309
pr feedback
igorroncevic 62ddf56
Merge branch 'feat/setup' into test/add-tests
igorroncevic 3fd952b
remove OZ, update tests
igorroncevic 56991da
apply copilot recommendation to use msg.value appropriately in histor…
igorroncevic 3a67749
Merge branch 'feat/setup' into test/add-tests
igorroncevic 0264db8
update snapshots
igorroncevic 497e211
pr feedback
igorroncevic 4273853
add swap and bridge tx
igorroncevic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| FORK_RPC_URL= | ||
| BASE_RPC_URL= | ||
| COW_HISTORICAL_TX_HASHES= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "historical tx - swap and bridge order - delegated call": "949703", | ||
| "historical tx - swap and bridge order - direct call": "945548" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "approved caller empty target payload - success - forwards": "24507", | ||
| "approved caller short calldata - success - receives ETH": "21760", | ||
| "approved caller short calldata - success - returns empty": "21760", | ||
| "approved caller target empty revert - reverts - bubbles empty data": "24861", | ||
| "approved caller target payload - success - forwards": "31258", | ||
| "approved caller target return data - success - bubbles return data": "25069", | ||
| "approved caller target revert data - reverts - bubbles non-empty data": "25738", | ||
| "unauthorized caller - success - receives ETH": "21232", | ||
| "unauthorized caller no value - reverts - unauthorized": "21930" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| { | ||
| "rules": { | ||
| "func-name-mixedcase": "off", | ||
| "gas-strict-inequalities": "off", | ||
| "gas-small-strings": "off", | ||
| "avoid-low-level-calls": "off", | ||
| "max-states-count": "off", | ||
| "no-empty-blocks": "off", | ||
| "use-natspec": "off" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // SPDX-License-Identifier: MIT OR Apache-2.0 | ||
| pragma solidity ^0.8.34; | ||
|
igorroncevic marked this conversation as resolved.
|
||
|
|
||
| import {Test} from "forge-std/Test.sol"; | ||
|
|
||
| /// @notice Shared setup and helpers for Solver7702Delegate tests. | ||
| abstract contract BaseTest is Test { | ||
| /// @notice Shared approved callers. | ||
| address[5] internal approvedCallers; | ||
|
|
||
| /// @notice Creates the default approved callers. | ||
| function setUp() public virtual { | ||
| approvedCallers = [ | ||
| makeAddr("APPROVED_CALLER_0"), | ||
| makeAddr("APPROVED_CALLER_1"), | ||
| makeAddr("APPROVED_CALLER_2"), | ||
| makeAddr("APPROVED_CALLER_3"), | ||
| makeAddr("APPROVED_CALLER_4") | ||
| ]; | ||
| } | ||
|
|
||
| /// @notice Encodes the delegate fallback calldata as a 20-byte target followed by payload. | ||
| function _packedCalldata(address target, bytes memory payload) internal pure returns (bytes memory) { | ||
| return abi.encodePacked(target, payload); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.