chore: trim eip712 deps (#1714)

* chore: trim eip712 deps

* chore: fmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Matthias Seitz 2022-09-18 17:51:03 +02:00 committed by GitHub
parent 1e83b86233
commit e89c7a378b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 15 deletions

2
Cargo.lock generated
View File

@ -1325,10 +1325,8 @@ dependencies = [
name = "ethers-derive-eip712" name = "ethers-derive-eip712"
version = "0.17.0" version = "0.17.0"
dependencies = [ dependencies = [
"ethers-contract",
"ethers-contract-derive", "ethers-contract-derive",
"ethers-core", "ethers-core",
"ethers-signers",
"hex", "hex",
"quote", "quote",
"serde_json", "serde_json",

View File

@ -16,6 +16,4 @@ hex = "0.4.3"
serde_json = "1.0.68" serde_json = "1.0.68"
[dev-dependencies] [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-contract-derive = { version = "^0.17.0", path = "../../ethers-contract/ethers-contract-derive" }
ethers-signers = { version = "^0.17.0", path = "../../ethers-signers" }

View File

@ -60,16 +60,14 @@
//! There is an Inner helper attribute `#[eip712]` for fields that will eventually be used to //! 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. //! determine if there is a nested eip712 struct. However, this work is not yet complete.
#![deny(rustdoc::broken_intra_doc_links)] #![deny(missing_docs, unsafe_code, rustdoc::broken_intra_doc_links)]
use std::convert::TryFrom;
use ethers_core::{macros::ethers_core_crate, types::transaction::eip712}; use ethers_core::{macros::ethers_core_crate, types::transaction::eip712};
use proc_macro::TokenStream; use proc_macro::TokenStream;
use quote::quote; use quote::quote;
use std::convert::TryFrom;
use syn::parse_macro_input; use syn::parse_macro_input;
/// Derive macro for `Eip712`
#[proc_macro_derive(Eip712, attributes(eip712))] #[proc_macro_derive(Eip712, attributes(eip712))]
pub fn eip_712_derive(input: TokenStream) -> TokenStream { pub fn eip_712_derive(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input); let ast = parse_macro_input!(input);

View File

@ -1,4 +1,4 @@
use ethers_contract::EthAbiType; use ethers_contract_derive::EthAbiType;
use ethers_core::{ use ethers_core::{
types::{ types::{
transaction::eip712::{ transaction::eip712::{
@ -61,10 +61,10 @@ fn test_struct_hash() {
} }
let domain = Domain { let domain = Domain {
name: "Radicle".to_string(), name: Some("Radicle".to_string()),
version: "1".to_string(), version: Some("1".to_string()),
chain_id: U256::from(1), chain_id: Some(U256::from(1)),
verifying_contract: H160::from(&[0; 20]), verifying_contract: Some(Address::zero()),
salt: None, salt: None,
}; };
@ -151,7 +151,7 @@ fn test_uniswap_v2_permit_hash() {
spender: "0x2819c144D5946404C0516B6f817a960dB37D4929".parse().unwrap(), spender: "0x2819c144D5946404C0516B6f817a960dB37D4929".parse().unwrap(),
value: parse_ether(10).unwrap(), value: parse_ether(10).unwrap(),
nonce: U256::from(1), nonce: U256::from(1),
deadline: U256::from(3133728498 as u32), deadline: U256::from(3133728498_u32),
}; };
let permit_hash = permit.encode_eip712().unwrap(); let permit_hash = permit.encode_eip712().unwrap();