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
Refactor crate determination in new ethers-macro crate #555
Refactor crate determination in new ethers-macro crate #555
Conversation
Hey @gakonst, this should solve the issue with needing to import |
this would be an opportunity to think about |
Yeah so: Let's make an |
Okay no problem! |
Amazing. Thank you. |
0efa345
to
fe871c4
Compare
Co-authored-by: Ryan <ryan.tate@fieldresponder.io>
5908899
to
1c10ffa
Compare
ethers-core/Cargo.toml
Outdated
@@ -14,6 +14,7 @@ rlp = { version = "0.5.0", default-features = false } | |||
ethabi = { version = "15.0", default-features = false, features = ["full-serde", "rlp"] } | |||
arrayvec = { version = "0.7.2", default-features = false } | |||
rlp-derive = { version = "0.1.0", default-features = false } | |||
cargo_metadata = "0.14.0" |
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.
Should this be optional = true
and enabled only if macros
is enabled?
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.
Yeah that makes sense since it's only used by the macros crate for now
Motivation
Currently when wanting to implement the EIP712 derive macro, one has to import
ethers_core
as a separate dependency, or declare it likeethers::core as ethers_core
.This is cumbersome and not clean.
Solution
By making use of the convenience function in
ethers::contract::abigen::ethers_core_crate()
we can compute a path and show it in the derive macro.By doing this we can avoid this additional
ethers_core
dependency in external projects.PR Checklist