-
Notifications
You must be signed in to change notification settings - Fork 153
Implement build.rs bindings generation #3827
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
Conversation
This reverts commit 9f08fac.
14fd890 to
0583047
Compare
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.
I have no clue how to review this other than by asking AI.
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.
I can do them one by one. I did this whole with AI too and did multilple rounds with different contexts. But this was more about proving that I was able to migrate everything with minimal changes on the main codebase
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.
Pull Request Overview
This PR refactors contract binding generation to use a build script approach with auto-generated code. The migration moves from runtime contract instance creation to compile-time code generation.
Key changes:
- Introduces
contracts-generatecrate with custom binding generation - Replaces runtime
InstanceExttrait with compile-time generated deployment info - Removes legacy
web3dummy transport and macros - Updates type references from
contracts::alloy::Providertoalloy::providers::DynProvider
Reviewed Changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/contracts-generate/Cargo.toml | New crate for build-time contract generation |
| crates/contracts-generate/src/lib.rs | Core generation logic with network deployment mapping |
| crates/contracts/build.rs | Build script defining all contract deployments |
| crates/contracts/src/lib.rs | Simplified to export generated bindings only |
| crates/contracts/src/alloy.rs | Deleted - replaced by generated code |
| crates/contracts/.gitignore | Ignores generated src/alloy directory |
| Multiple usage files | Updated to remove InstanceExt imports and use DynProvider |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
squadgazzz
left a comment
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.
LGTM
|
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
MartinquaXD
left a comment
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.
Looks nice with the build stuff being part of the contract crate now.
Description
Implements bindings generation in
build.rs, adding this allowsChanges
contracts::alloy::Provider->alloy::providers::DynProvider)How to test
Run existing tests & compile