-
Notifications
You must be signed in to change notification settings - Fork 795
feat: add dependencies
to MultiBindingsInner
#2606
feat: add dependencies
to MultiBindingsInner
#2606
Conversation
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.
almost there :)
root, | ||
bindings, | ||
shared_types, | ||
dependencies: vec![String::from(r#"serde = "1.0.188""#)], |
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.
hmm I don't think we serde by default here
what we need is a setter function just like MultiBindings::format
ethers-rs/ethers-contract/ethers-contract-abigen/src/multi.rs
Lines 395 to 402 in a65abb5
/// Specify whether to format the code or not. True by default. | |
/// | |
/// This will use [`prettyplease`], so the resulting formatted code **will not** be affected by | |
/// the local `rustfmt` version or config. | |
pub fn format(mut self, format: bool) -> Self { | |
self.format = format; | |
self | |
} |
so that this can be set manually:
MultiBindings::dependencies(impl IntoIter<impl Into<String>) -> Self
@mattsse you think this is good a enough approach? I'll fix linter issues. Any tests or anything you need me to add here? Doesn't seem breaking! |
just want this addressed, then this is good to merge |
Ah okay I will get to it. My jet lagged brain missed your comment! 😅 |
Alright, I think that does it. I appreciate the help and I see how that externalizes it now and it seems to be working with a slight change in Foundry now too. |
@mattsse just checking in on this, I just ran the formatter and hoping this passes now. |
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
paging @DaniPopes
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 sorry for the delay - good improvement, thank you
Motivation
This seeks to close #2599 and should link to Foundry PR #5836. The intent is to be able to allow for
serde::{Deserialize, Serialize}
to be derived on contract bindings either via module or crate.PR here has the intent of providing support for an additional dependency in the
Cargo.toml
generated when bindings are output as a crate.Solution
This solution here seems a bit simplistic and forcefully assumes the end user will want a specific version of
serde
as an included dependency. It could be good, instead, to:serde
derives to the contract bindings at this level.serde
version or the version used withinethers-rs
directly.Let me know if we wish to make any of the above changes or otherwise!
PR Checklist