Repository: gakonst/ethers-rs
Pull request #1714 (2022-09-18 14:40:47)

chore: trim eip712 deps
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Bug fixes and new features should include tests.

Contributors guide: https://github.com/gakonst/ethers-rs/blob/master/CONTRIBUTING.md

The contributors guide includes instructions for running rustfmt and building the
documentation.
-->

## Motivation
Should close https://github.com/gakonst/ethers-rs/issues/1713

depend on `ethers_contract_derive` crate instead and rm unused crates

@DaniPopes could you please check this?

<!--
Explain the context and why you're making that change. What is the problem
you're trying to solve? In some cases there is not a problem and this can be
thought of as being the motivation for your change.
-->

## Solution

<!--
Summarize the solution and provide any necessary context needed to understand
the code change.
-->

## PR Checklist

- [ ] Added Tests
- [ ] Added Documentation
- [ ] Updated the changelog



Patch:
diff --git a/.clippy.toml b/.clippy.toml
new file mode 100644
index 00000000..6bfeada7
--- /dev/null
+++ b/.clippy.toml
@@ -0,0 +1,1 @@
+msrv = "1.62"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4bbad810..40090899 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
 
 ### Unreleased
 
+- Add comment about safety of u8 -> u64 cast in `ethers_core::types::Signature`
 - Stop defaulting to the `"latest"` block in `eth_estimateGas` params [#1657](https://github.com/gakonst/ethers-rs/pull/1657)
 - Fix geth trace types for debug_traceTransaction rpc
 - Fix RLP decoding of legacy `Transaction`
diff --git a/Cargo.lock b/Cargo.lock
index ea0d1e9c..33a1a38a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1325,10 +1325,8 @@ dependencies = [
 name = "ethers-derive-eip712"
 version = "0.17.0"
 dependencies = [
- "ethers-contract",
  "ethers-contract-derive",
  "ethers-core",
- "ethers-signers",
  "hex",
  "quote",
  "serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index 29934e47..5eb28a78 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,16 +1,15 @@
 [package]
 name = "ethers"
 version = "0.17.0"
+edition = "2021"
+rust-version = "1.62"
 authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
 license = "MIT OR Apache-2.0"
-edition = "2021"
 readme = "README.md"
 documentation = "https://docs.rs/ethers"
 repository = "https://github.com/gakonst/ethers-rs"
 homepage = "https://docs.rs/ethers"
-description = """
-Complete Ethereum library and wallet implementation in Rust.
-"""
+description = "Complete Ethereum library and wallet implementation in Rust."
 
 [workspace]
 members = [
@@ -22,7 +21,7 @@ members = [
     "ethers-middleware",
     "ethers-etherscan",
     "ethers-solc",
-    "examples/ethers-wasm",
+    "examples/ethers-wasm"
 ]
 
 default-members = [
@@ -33,7 +32,7 @@ default-members = [
     "ethers-core",
     "ethers-middleware",
     "ethers-etherscan",
-    "ethers-solc",
+    "ethers-solc"
 ]
 
 [package.metadata.docs.rs]
@@ -55,10 +54,7 @@ celo = [
     "legacy"
 ]
 
-legacy = [
-    "ethers-core/legacy",
-    "ethers-contract/legacy"
-]
+legacy = ["ethers-core/legacy", "ethers-contract/legacy"]
 
 # individual features per sub-crate
 ## core
@@ -66,8 +62,18 @@ eip712 = ["ethers-contract/eip712", "ethers-core/eip712"]
 ## providers
 ws = ["ethers-providers/ws"]
 ipc = ["ethers-providers/ipc"]
-rustls = ["ethers-providers/rustls", "ethers-etherscan/rustls", "ethers-contract/rustls", "ethers-solc/rustls"]
-openssl = ["ethers-providers/openssl", "ethers-etherscan/openssl", "ethers-contract/openssl", "ethers-solc/openssl"]
+rustls = [
+    "ethers-providers/rustls",
+    "ethers-etherscan/rustls",
+    "ethers-contract/rustls",
+    "ethers-solc/rustls"
+]
+openssl = [
+    "ethers-providers/openssl",
+    "ethers-etherscan/openssl",
+    "ethers-contract/openssl",
+    "ethers-solc/openssl"
+]
 dev-rpc = ["ethers-providers/dev-rpc"]
 ## signers
 ledger = ["ethers-signers/ledger"]
@@ -93,11 +99,19 @@ ethers-solc = { version = "^0.17.0", default-features = false, path = "./ethers-
 ethers-etherscan = { version = "^0.17.0", default-features = false, path = "./ethers-etherscan" }
 
 [dev-dependencies]
-ethers-contract = { version = "^0.17.0", default-features = false, path = "./ethers-contract", features = ["abigen", "eip712"] }
-ethers-providers = { version = "^0.17.0", default-features = false, path = "./ethers-providers", features = ["ws"] }
+ethers-contract = { version = "^0.17.0", default-features = false, path = "./ethers-contract", features = [
+    "abigen",
+    "eip712"
+] }
+ethers-providers = { version = "^0.17.0", default-features = false, path = "./ethers-providers", features = [
+    "ws"
+] }
 
 [target.'cfg(target_family = "unix")'.dev-dependencies]
-ethers-providers = { version = "^0.17.0", default-features = false, path = "./ethers-providers", features = ["ws", "ipc"] }
+ethers-providers = { version = "^0.17.0", default-features = false, path = "./ethers-providers", features = [
+    "ws",
+    "ipc"
+] }
 eyre = "0.6"
 rand = "0.8.5"
 serde = { version = "1.0.124", features = ["derive"] }
@@ -106,13 +120,11 @@ tokio = { version = "1.18", features = ["macros", "rt-multi-thread"] }
 hex = "0.4.3"
 bytes = "1.2.1"
 
-
 # profile for the wasm example
 [profile.release.package.ethers-wasm]
 # Tell `rustc` to optimize for small code size.
 opt-level = "s"
 
-
 [[example]]
 name = "abigen"
 path = "examples/abigen.rs"
diff --git a/ethers-addressbook/Cargo.toml b/ethers-addressbook/Cargo.toml
index d88aba49..eb5e0d96 100644
--- a/ethers-addressbook/Cargo.toml
+++ b/ethers-addressbook/Cargo.toml
@@ -2,8 +2,9 @@
 name = "ethers-addressbook"
 version = "0.17.0"
 edition = "2021"
-license = "MIT OR Apache-2.0"
+rust-version = "1.62"
 authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
+license = "MIT OR Apache-2.0"
 description = "Common Ethereum name to address mappings"
 homepage = "https://docs.rs/ethers"
 repository = "https://github.com/gakonst/ethers-rs"
diff --git a/ethers-contract/Cargo.toml b/ethers-contract/Cargo.toml
index 85e8fb01..988ac4dc 100644
--- a/ethers-contract/Cargo.toml
+++ b/ethers-contract/Cargo.toml
@@ -1,9 +1,10 @@
 [package]
 name = "ethers-contract"
-license = "MIT OR Apache-2.0"
 version = "0.17.0"
-authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
 edition = "2018"
+rust-version = "1.62"
+authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
+license = "MIT OR Apache-2.0"
 description = "Smart contract bindings for the ethers-rs crate"
 homepage = "https://docs.rs/ethers"
 repository = "https://github.com/gakonst/ethers-rs"
@@ -12,7 +13,7 @@ keywords = ["ethereum", "web3", "celo", "ethers"]
 [dependencies]
 ethers-providers = { version = "^0.17.0", path = "../ethers-providers", default-features = false }
 ethers-core = { version = "^0.17.0", path = "../ethers-core", default-features = false }
-ethers-contract-abigen = { version = "^0.17.0", path = "ethers-contract-abigen",  default-features = false, optional = true }
+ethers-contract-abigen = { version = "^0.17.0", path = "ethers-contract-abigen", default-features = false, optional = true }
 ethers-contract-derive = { version = "^0.17.0", path = "ethers-contract-derive", optional = true }
 ethers-derive-eip712 = { version = "^0.17.0", path = "../ethers-core/ethers-derive-eip712", optional = true }
 
@@ -20,18 +21,22 @@ serde = { version = "1.0.124", default-features = false }
 serde_json = { version = "1.0.64", default-features = false }
 thiserror = { version = "1.0", default-features = false }
 once_cell = { version = "1.14.0" }
-pin-project = {version = "1.0.11", default-features = false }
+pin-project = { version = "1.0.11", default-features = false }
 futures-util = { version = "^0.3" }
 hex = { version = "0.4.3", default-features = false, features = ["std"] }
 
 [dev-dependencies]
 ethers-middleware = { version = "^0.17.0", path = "../ethers-middleware" }
-ethers-providers = { version = "^0.17.0", path = "../ethers-providers", default-features = false, features = ["ws"] }
+ethers-providers = { version = "^0.17.0", path = "../ethers-providers", default-features = false, features = [
+    "ws"
+] }
 ethers-signers = { version = "^0.17.0", path = "../ethers-signers" }
 ethers-contract-abigen = { version = "^0.17.0", path = "ethers-contract-abigen" }
 ethers-contract-derive = { version = "^0.17.0", path = "ethers-contract-derive" }
-ethers-core = { version = "^0.17.0", path = "../ethers-core", default-features = false, features = ["eip712"]}
-ethers-derive-eip712 = { version = "^0.17.0", path = "../ethers-core/ethers-derive-eip712"}
+ethers-core = { version = "^0.17.0", path = "../ethers-core", default-features = false, features = [
+    "eip712"
+] }
+ethers-derive-eip712 = { version = "^0.17.0", path = "../ethers-core/ethers-derive-eip712" }
 ethers-solc = { version = "^0.17.0", path = "../ethers-solc", default-features = false }
 
 [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
diff --git a/ethers-core/Cargo.toml b/ethers-core/Cargo.toml
index 6f04639c..4d13d1d1 100644
--- a/ethers-core/Cargo.toml
+++ b/ethers-core/Cargo.toml
@@ -2,6 +2,7 @@
 name = "ethers-core"
 license = "MIT OR Apache-2.0"
 version = "0.17.0"
+rust-version = "1.62"
 authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
 edition = "2018"
 description = "Core structures for the ethers-rs crate"
diff --git a/ethers-core/ethers-derive-eip712/Cargo.toml b/ethers-core/ethers-derive-eip712/Cargo.toml
index 0dd170f6..b5247d3b 100644
--- a/ethers-core/ethers-derive-eip712/Cargo.toml
+++ b/ethers-core/ethers-derive-eip712/Cargo.toml
@@ -16,6 +16,4 @@ hex = "0.4.3"
 serde_json = "1.0.68"
 
 [dev-dependencies]
-ethers-contract = { version = "^0.17.0", path = "../../ethers-contract", features = ["abigen"]}
 ethers-contract-derive = { version = "^0.17.0", path = "../../ethers-contract/ethers-contract-derive" }
-ethers-signers = { version = "^0.17.0", path = "../../ethers-signers" }
diff --git a/ethers-core/ethers-derive-eip712/src/lib.rs b/ethers-core/ethers-derive-eip712/src/lib.rs
index a64bb351..2670c3f7 100644
--- a/ethers-core/ethers-derive-eip712/src/lib.rs
+++ b/ethers-core/ethers-derive-eip712/src/lib.rs
@@ -60,16 +60,14 @@
 //! There is an Inner helper attribute `#[eip712]` for fields that will eventually be used to
 //! determine if there is a nested eip712 struct. However, this work is not yet complete.
 
-#![deny(rustdoc::broken_intra_doc_links)]
-
-use std::convert::TryFrom;
-
+#![deny(missing_docs, unsafe_code, rustdoc::broken_intra_doc_links)]
 use ethers_core::{macros::ethers_core_crate, types::transaction::eip712};
-
 use proc_macro::TokenStream;
 use quote::quote;
+use std::convert::TryFrom;
 use syn::parse_macro_input;
 
+/// Derive macro for `Eip712`
 #[proc_macro_derive(Eip712, attributes(eip712))]
 pub fn eip_712_derive(input: TokenStream) -> TokenStream {
     let ast = parse_macro_input!(input);
diff --git a/ethers-core/src/types/signature.rs b/ethers-core/src/types/signature.rs
index 8e2ff8e9..f0ef3685 100644
--- a/ethers-core/src/types/signature.rs
+++ b/ethers-core/src/types/signature.rs
@@ -215,6 +215,11 @@ impl From<&Signature> for [u8; 65] {
         sig[32..64].copy_from_slice(&s_bytes);
         // TODO: What if we try to serialize a signature where
         // the `v` is not normalized?
+
+        // The u64 to u8 cast is safe because `sig.v` can only ever be 27 or 28
+        // here. Regarding EIP-155, the modification to `v` happens during tx
+        // creation only _after_ the transaction is signed using
+        // `ethers_signers::to_eip155_v`.
         sig[64] = src.v as u8;
         sig
     }
diff --git a/ethers-core/src/utils/anvil.rs b/ethers-core/src/utils/anvil.rs
index 06fc1bdb..1c8f59c2 100644
--- a/ethers-core/src/utils/anvil.rs
+++ b/ethers-core/src/utils/anvil.rs
@@ -11,7 +11,7 @@ use std::{
 };
 
 /// How long we will wait for anvil to indicate that it is ready.
-const ANVIL_STARTUP_TIMEOUT_MILLIS: u64 = 5_000;
+const ANVIL_STARTUP_TIMEOUT_MILLIS: u64 = 10_000;
 
 /// An anvil CLI instance. Will close the instance when dropped.
 ///
@@ -93,6 +93,7 @@ pub struct Anvil {
     fork: Option<String>,
     fork_block_number: Option<u64>,
     args: Vec<String>,
+    timeout: Option<u64>,
 }
 
 impl Anvil {
@@ -206,6 +207,13 @@ impl Anvil {
         self
     }
 
+    /// Sets the timeout which will be used when the `anvil` instance is launched.
+    #[must_use]
+    pub fn timeout<T: Into<u64>>(mut self, timeout: T) -> Self {
+        self.timeout = Some(timeout.into());
+        self
+    }
+
     /// Consumes the builder and spawns `anvil` with stdout redirected
     /// to /dev/null.
     pub fn spawn(self) -> AnvilInstance {
@@ -251,7 +259,9 @@ impl Anvil {
         let mut addresses = Vec::new();
         let mut is_private_key = false;
         loop {
-            if start + Duration::from_millis(ANVIL_STARTUP_TIMEOUT_MILLIS) <= Instant::now() {
+            if start + Duration::from_millis(self.timeout.unwrap_or(ANVIL_STARTUP_TIMEOUT_MILLIS)) <=
+                Instant::now()
+            {
                 panic!("Timed out waiting for anvil to start. Is anvil installed?")
             }
 
diff --git a/ethers-etherscan/Cargo.toml b/ethers-etherscan/Cargo.toml
index fe208aae..29e79c0e 100644
--- a/ethers-etherscan/Cargo.toml
+++ b/ethers-etherscan/Cargo.toml
@@ -1,7 +1,11 @@
 [package]
 name = "ethers-etherscan"
 version = "0.17.0"
-authors = ["Matthias Seitz <matthias.seitz@outlook.de>", "Georgios Konstantopoulos <me@gakonst.com>"]
+rust-version = "1.62"
+authors = [
+    "Matthias Seitz <matthias.seitz@outlook.de>",
+    "Georgios Konstantopoulos <me@gakonst.com>"
+]
 license = "MIT OR Apache-2.0"
 edition = "2018"
 readme = "../README.md"
diff --git a/ethers-middleware/Cargo.toml b/ethers-middleware/Cargo.toml
index cae1bcf0..5fd9e868 100644
--- a/ethers-middleware/Cargo.toml
+++ b/ethers-middleware/Cargo.toml
@@ -1,9 +1,10 @@
 [package]
 name = "ethers-middleware"
-license = "MIT OR Apache-2.0"
 version = "0.17.0"
-authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
 edition = "2018"
+rust-version = "1.62"
+authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
+license = "MIT OR Apache-2.0"
 description = "Middleware implementations for the ethers-rs crate"
 homepage = "https://docs.rs/ethers"
 repository = "https://github.com/gakonst/ethers-rs"
@@ -34,7 +35,7 @@ reqwest = { version = "0.11.11", default-features = false, features = ["json", "
 url = { version = "2.3.1", default-features = false }
 
 serde_json = { version = "1.0.64", default-features = false }
-instant = {version = "0.1.12", features = ["now"] }
+instant = { version = "0.1.12", features = ["now"] }
 
 [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
 tokio = { version = "1.18" }
@@ -42,7 +43,10 @@ tokio = { version = "1.18" }
 [dev-dependencies]
 hex = { version = "0.4.3", default-features = false, features = ["std"] }
 rand = { version = "0.8.5", default-features = false }
-ethers-providers = { version = "^0.17.0", path = "../ethers-providers", default-features = false, features = ["ws", "rustls"] }
+ethers-providers = { version = "^0.17.0", path = "../ethers-providers", default-features = false, features = [
+    "ws",
+    "rustls"
+] }
 once_cell = "1.14.0"
 ethers-solc = { version = "^0.17.0", path = "../ethers-solc" }
 serial_test = "0.9.0"
diff --git a/ethers-providers/Cargo.toml b/ethers-providers/Cargo.toml
index 807ed53d..021ee7a6 100644
--- a/ethers-providers/Cargo.toml
+++ b/ethers-providers/Cargo.toml
@@ -1,9 +1,10 @@
 [package]
 name = "ethers-providers"
-license = "MIT OR Apache-2.0"
 version = "0.17.0"
-authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
 edition = "2018"
+rust-version = "1.62"
+authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
+license = "MIT OR Apache-2.0"
 description = "Provider implementations for the ethers-rs crate"
 homepage = "https://docs.rs/ethers"
 repository = "https://github.com/gakonst/ethers-rs"
@@ -38,21 +39,22 @@ pin-project = { version = "1.0.11", default-features = false }
 tracing = { version = "0.1.36", default-features = false }
 tracing-futures = { version = "0.2.5", default-features = false, features = ["std-future"] }
 
-bytes = { version  = "1.2.1", default-features = false, optional = true }
+bytes = { version = "1.2.1", default-features = false, optional = true }
 once_cell = "1.14.0"
 hashers = "1.0.1"
 
 [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
 # tokio
 tokio = { version = "1.18", features = ["time"] }
-tokio-tungstenite = { version = "0.17.2", default-features = false, features = ["connect"], optional = true }
-
+tokio-tungstenite = { version = "0.17.2", default-features = false, features = [
+    "connect"
+], optional = true }
 
 [target.'cfg(target_arch = "wasm32")'.dependencies]
 ws_stream_wasm = "0.7"
 wasm-bindgen = "0.2"
 wasm-bindgen-futures = "0.4"
-web-sys = { version  = "0.3", features = ["console"] }
+web-sys = { version = "0.3", features = ["console"] }
 wasm-timer = "0.2"
 # this is currently necessary for `wasm-timer::Delay` to work
 parking_lot = { version = "0.11", features = ["wasm-bindgen"] }
diff --git a/ethers-signers/Cargo.toml b/ethers-signers/Cargo.toml
index b5f7a805..84ab59a9 100644
--- a/ethers-signers/Cargo.toml
+++ b/ethers-signers/Cargo.toml
@@ -1,9 +1,10 @@
 [package]
 name = "ethers-signers"
-license = "MIT OR Apache-2.0"
 version = "0.17.0"
-authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
 edition = "2018"
+rust-version = "1.62"
+authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
+license = "MIT OR Apache-2.0"
 description = "Signer implementations for the ethers-rs crate"
 homepage = "https://docs.rs/ethers"
 repository = "https://github.com/gakonst/ethers-rs"
@@ -14,7 +15,7 @@ all-features = true
 rustdoc-args = ["--cfg", "docsrs"]
 
 [dependencies]
-ethers-core = { version = "^0.17.0", path = "../ethers-core", features = ["eip712"]}
+ethers-core = { version = "^0.17.0", path = "../ethers-core", features = ["eip712"] }
 thiserror = { version = "1.0.35", default-features = false }
 coins-bip32 = "0.7.0"
 coins-bip39 = "0.7.0"
@@ -27,8 +28,10 @@ rand = { version = "0.8.5", default-features = false }
 yubihsm = { version = "0.41.0", features = ["secp256k1", "http", "usb"], optional = true }
 futures-util = { version = "^0.3", optional = true }
 futures-executor = { version = "^0.3", optional = true }
-semver = { version =  "1.0.14", optional = true }
-trezor-client = { version = "0.0.6", optional = true, default-features = false, features = ["f_ethereum"] }
+semver = { version = "1.0.14", optional = true }
+trezor-client = { version = "0.0.6", optional = true, default-features = false, features = [
+    "f_ethereum"
+] }
 
 # aws
 rusoto_core = { version = "0.48.0", optional = true }
@@ -41,7 +44,10 @@ eth-keystore = { version = "0.5.0" }
 home = { version = "0.5.3", optional = true }
 
 [dev-dependencies]
-ethers-contract = { version = "^0.17.0", path = "../ethers-contract", features = ["eip712", "abigen"]}
+ethers-contract = { version = "^0.17.0", path = "../ethers-contract", features = [
+    "eip712",
+    "abigen"
+] }
 ethers-derive-eip712 = { version = "^0.17.0", path = "../ethers-core/ethers-derive-eip712" }
 serde_json = { version = "1.0.64" }
 tracing-subscriber = "0.3.15"
diff --git a/ethers-solc/Cargo.toml b/ethers-solc/Cargo.toml
index df21f079..a3d714b6 100644
--- a/ethers-solc/Cargo.toml
+++ b/ethers-solc/Cargo.toml
@@ -1,16 +1,18 @@
 [package]
 name = "ethers-solc"
 version = "0.17.0"
-authors = ["Matthias Seitz <matthias.seitz@outlook.de>", "Georgios Konstantopoulos <me@gakonst.com>"]
-license = "MIT OR Apache-2.0"
 edition = "2018"
+rust-version = "1.62"
+authors = [
+    "Matthias Seitz <matthias.seitz@outlook.de>",
+    "Georgios Konstantopoulos <me@gakonst.com>"
+]
+license = "MIT OR Apache-2.0"
 readme = "../README.md"
 documentation = "https://docs.rs/ethers"
 repository = "https://github.com/gakonst/ethers-rs"
 homepage = "https://docs.rs/ethers"
-description = """
-Utilites for working with solc
-"""
+description = "Utilites for working with solc"
 keywords = ["ethereum", "web3", "solc", "solidity", "ethers"]
 
 [dependencies]
@@ -43,8 +45,10 @@ cfg-if = "1.0.0"
 
 [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
 home = "0.5.3"
-svm = { package = "svm-rs", version = "0.2.16", default-features = false, optional = true, features = ["blocking"] }
-svm-builds = { package = "svm-rs-builds", version = "0.1.8", optional = true}
+svm = { package = "svm-rs", version = "0.2.16", default-features = false, optional = true, features = [
+    "blocking"
+] }
+svm-builds = { package = "svm-rs-builds", version = "0.1.8", optional = true }
 
 [target.'cfg(target_arch = "wasm32")'.dependencies]
 # NOTE: this enables wasm compatibility for getrandom indirectly
@@ -53,7 +57,7 @@ getrandom = { version = "0.2", features = ["js"] }
 [dev-dependencies]
 criterion = { version = "0.3", features = ["async_tokio"] }
 env_logger = "*"
-tracing-subscriber = {version = "0.3", default-features = false, features = ["env-filter", "fmt"]}
+tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
 rand = "0.8.5"
 pretty_assertions = "1.3.0"
 tempfile = "3.3.0"


Test patch:
diff --git a/ethers-core/ethers-derive-eip712/tests/derive_eip712.rs b/ethers-core/ethers-derive-eip712/tests/derive_eip712.rs
index 2779e50f..1f821e9f 100644
--- a/ethers-core/ethers-derive-eip712/tests/derive_eip712.rs
+++ b/ethers-core/ethers-derive-eip712/tests/derive_eip712.rs
@@ -1,4 +1,4 @@
-use ethers_contract::EthAbiType;
+use ethers_contract_derive::EthAbiType;
 use ethers_core::{
     types::{
         transaction::eip712::{
@@ -61,10 +61,10 @@ fn test_struct_hash() {
     }
 
     let domain = Domain {
-        name: "Radicle".to_string(),
-        version: "1".to_string(),
-        chain_id: U256::from(1),
-        verifying_contract: H160::from(&[0; 20]),
+        name: Some("Radicle".to_string()),
+        version: Some("1".to_string()),
+        chain_id: Some(U256::from(1)),
+        verifying_contract: Some(Address::zero()),
         salt: None,
     };
 
@@ -151,7 +151,7 @@ fn test_uniswap_v2_permit_hash() {
         spender: "0x2819c144D5946404C0516B6f817a960dB37D4929".parse().unwrap(),
         value: parse_ether(10).unwrap(),
         nonce: U256::from(1),
-        deadline: U256::from(3133728498 as u32),
+        deadline: U256::from(3133728498_u32),
     };
 
     let permit_hash = permit.encode_eip712().unwrap();