-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cast: s/build_tx/TxBuilder/ #1082
Conversation
Fixes foundry-rs#937 Refactoring to move away from function-with-hundred-arguments to a Builder pattern
868a9d3
to
6c76711
Compare
ready for review |
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 just have some nits, mostly that you start docblocks with an empty ///
line, otherwise LGTM
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.
really nice work - agree with Bjerg's nits, plus some more changes requested
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.
Nice work - thanks!
Refactoring to move away from function-with-hundred-arguments to a Builder pattern
Fixes #937
TxBuilder constructs the tx on the fly, that's why the interface is not super consistent (
args()
returns a future result, while other setters return &mut self), and provider needs to be passed to some of the setters.Alternatively, I can change TxBuilder to be just a glorified bag-of-arguments, and leave the actual transaction building in lib.tx. The downsides will be: 1) we'll still have 1 gigantic function that need to handle every field in TxBuilder; 2) it'll use a bit more memory
I'm not 100% confident in my Rust, so plz check for dumb things