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

Commit

Permalink
chore: trim eip712 deps (#1714)
Browse files Browse the repository at this point in the history
* chore: trim eip712 deps

* chore: fmt

Co-authored-by: Georgios Konstantopoulos <[email protected]>
  • Loading branch information
mattsse and gakonst authored Sep 18, 2022
1 parent 1e83b86 commit e89c7a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions ethers-core/ethers-derive-eip712/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
8 changes: 3 additions & 5 deletions ethers-core/ethers-derive-eip712/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions ethers-core/ethers-derive-eip712/tests/derive_eip712.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ethers_contract::EthAbiType;
use ethers_contract_derive::EthAbiType;
use ethers_core::{
types::{
transaction::eip712::{
Expand Down Expand Up @@ -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,
};

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e89c7a3

Please sign in to comment.