-
Notifications
You must be signed in to change notification settings - Fork 33
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
add custom evm-version to abigen #1768
Conversation
WalkthroughThe recent updates involve integrating a new package, adding flags to handle continuous integration and EVM versions, and updating functions for Solidity file handling and compilation. These changes are aimed at enhancing the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1768 +/- ##
===================================================
+ Coverage 51.92478% 52.29333% +0.36854%
===================================================
Files 364 372 +8
Lines 24782 25596 +814
Branches 285 285
===================================================
+ Hits 12868 13385 +517
- Misses 10667 10904 +237
- Partials 1247 1307 +60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (4)
- tools/abigen/cmd/commands.go (4 hunks)
- tools/abigen/internal/export_test.go (1 hunks)
- tools/abigen/internal/generate.go (4 hunks)
- tools/abigen/internal/generate_test.go (3 hunks)
Additional comments: 12
tools/abigen/internal/export_test.go (1)
- 14-15: The addition of the
evmVersion
parameter to theCompileSolidity
function aligns with the PR's objectives to support custom EVM versions. Ensure that all calls to this function have been updated accordingly.tools/abigen/internal/generate_test.go (3)
4-7: The new imports for
encoding/json
,github.com/synapsecns/sanguine/core
, andjackfan.us.kg/synapsecns/sanguine/ethergo/debug
are necessary for the added test functionality.30-31: Renaming
TestCompileSolidity
toTestCompileSolidityImplicitEVM
clarifies the intent of the test to cover the implicit EVM version scenario.41-60: The addition of
TestCompileSolidityExplicitEVM
is a good practice to ensure that the new functionality for setting an explicit EVM version is working as expected.tools/abigen/cmd/commands.go (5)
6-6: The import of
github.com/synapsecns/sanguine/core
is necessary for thestrToPt
utility function which is used to handle the newevm-version
flag.37-57: The new flags
disable-ci
andevm-version
are correctly defined and serve their intended purpose to control the regeneration on CI and to specify the EVM version.59-66: The
strToPt
function is a utility that correctly handles the conversion of a string to a pointer, which is useful for optional command-line flags.78-87: The
GenerateCommand
action has been updated to include the newevm-version
flag and to handle thedisable-ci
flag, which is consistent with the PR's objectives.112-121: The
EtherscanCommand
action has been modified to handle thedisableCIEtherscan
flag and to pass theevmVersionFlags
parameter, aligning with the new feature's requirements.tools/abigen/internal/generate.go (3)
- 32-38: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [35-54]
The
GenerateABIFromEtherscan
function now creates the Solidity file in a specific directory. Ensure that the file is properly cleaned up after its use to prevent any resource leaks.
58-60: The
BuildTemplates
function has been updated to accept anevmVersion
parameter, which is correctly passed to thecompileSolidity
function, aligning with the PR's objectives.183-193: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [126-190]
The
compileSolidity
function has been correctly updated to accept anevmVersion
parameter and to include it in the compilation arguments when it is not nil.
This was a feature that was needed for #1650 since our version of embedded geth is too old to support push0 (see #1767). It also allows us to target any evm for abigen by passing the param to the solc compiler.
Summary by CodeRabbit
New Features
Improvements
Testing Enhancements