Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat: syn 2.0, merge eip712 crate into ethers-contract-derive #2279

Merged
merged 13 commits into from
Apr 9, 2023

Conversation

DaniPopes
Copy link
Collaborator

@DaniPopes DaniPopes commented Mar 18, 2023

Motivation

https://github.com/dtolnay/syn/releases/tag/2.0.0

Blocked by:

  • prettyplease (abigen formatting)

Haven't updated yet (doesn't block):

  • async-trait
  • auto_impl
  • clap_derive (from criterion and svm-rs)
  • ctor (dev; from pretty_assertions)
  • derive_more (from ethereum-types)
  • futures-macro
  • impl-trait-for-tuples (from ethbloom)
  • num_enum_derive
  • open-fastrlp-derive
  • parity-scale-codec-derive
  • phf_macros (from phf <- solang-parser)
  • pin-project-internal (from pin-project)
  • proc-macro-error (from auto_impl, clap_derive; seen above)
  • rlp-derive
  • serde_derive
  • serial_test_derive (dev)
  • signature_derive
  • strum_macros
  • synstructure
  • thiserror-impl
  • tokio-macros
  • tracing-attributes
  • tracing-test-macro
  • wasm-bindgen-backend
  • wasm-bindgen-macro-support
  • zeroize_derive

Solution

Fix breaking changes, mainly:

  • input.parse_terminated from turbofish to argument
  • attribute parsing

Additionally, moves ethers-derive-eip712 to ethers-contract-derive due to duplicated code and useless duplicated dependencies on ethers-core. Also removes deprecates the feature since it doesn't gate dependencies anymore.

TODO

  • revert temp prettyplease fix
  • fix eip712 test: ethers_contract::it::contract::test_derive_eip712

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@DaniPopes DaniPopes marked this pull request as draft March 18, 2023 18:57
@DaniPopes DaniPopes marked this pull request as ready for review March 25, 2023 01:52
@DaniPopes DaniPopes changed the title chore(deps): bump syn from 1.0 to 2.0 feat: syn 2.0 Mar 25, 2023
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines +9 to +11
/// Parses the specified attributes from a `syn::Attribute` iterator.
macro_rules! parse_attributes {
($attrs:expr, $attr_ident:literal, $meta:ident, $($field:pat, $opt:expr => $block:block)*) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syn 2 has a few breaking changes when it comes to extracting attributes, this seems like a useful helper to have

@prestwich
Copy link
Collaborator

is this a breaking change? can't quite tell if it moves the eip712 derive to a different place

@DaniPopes
Copy link
Collaborator Author

the crate won't be published anymore but the exports should be the same

only breaking change is the removal of the "eip712" feature

@prestwich
Copy link
Collaborator

is it worth leaving the feature as a no-op for compatibility?

@DaniPopes DaniPopes changed the title feat: syn 2.0 feat: syn 2.0, merge eip712 crate into ethers-contract-derive Apr 6, 2023
@DaniPopes
Copy link
Collaborator Author

is it worth leaving the feature as a no-op for compatibility?

Done

@prestwich prestwich merged commit 6e59afe into gakonst:master Apr 9, 2023
@DaniPopes DaniPopes deleted the feat/syn-2 branch April 12, 2023 18:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants