diff --git a/Cargo.lock b/Cargo.lock index 43b7f81d..6b7c6490 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1238,7 +1238,6 @@ dependencies = [ "ethers-contract-derive", "ethers-core", "ethers-derive-eip712", - "ethers-middleware", "ethers-providers", "ethers-signers", "ethers-solc", @@ -1429,7 +1428,7 @@ dependencies = [ "coins-ledger", "elliptic-curve", "eth-keystore", - "ethers-contract", + "ethers-contract-derive", "ethers-core", "ethers-derive-eip712", "futures-executor", diff --git a/ethers-contract/Cargo.toml b/ethers-contract/Cargo.toml index d6512ab6..db602458 100644 --- a/ethers-contract/Cargo.toml +++ b/ethers-contract/Cargo.toml @@ -26,7 +26,6 @@ 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" ] } diff --git a/ethers-contract/tests/it/abigen.rs b/ethers-contract/tests/it/abigen.rs index d09c2b96..dbcaa1df 100644 --- a/ethers-contract/tests/it/abigen.rs +++ b/ethers-contract/tests/it/abigen.rs @@ -7,9 +7,7 @@ use ethers_core::{ types::{transaction::eip2718::TypedTransaction, Chain, Eip1559TransactionRequest, U256}, utils::Anvil, }; -use ethers_middleware::SignerMiddleware; use ethers_providers::{MockProvider, Provider}; -use ethers_signers::{LocalWallet, Signer}; use ethers_solc::Solc; use std::{ convert::{TryFrom, TryInto}, @@ -617,11 +615,14 @@ fn can_handle_overloaded_events() { async fn can_send_struct_param() { abigen!(StructContract, "./tests/solidity-contracts/StructContract.json"); - let server = Anvil::new().spawn(); - let wallet: LocalWallet = server.keys()[0].clone().into(); - let provider = Provider::try_from(server.endpoint()).unwrap(); - let client = - Arc::new(SignerMiddleware::new(provider, wallet.with_chain_id(Chain::AnvilHardhat))); + // launch the network & connect to it + let anvil = Anvil::new().spawn(); + let from = anvil.addresses()[0]; + let provider = Provider::try_from(anvil.endpoint()) + .unwrap() + .with_sender(from) + .interval(std::time::Duration::from_millis(10)); + let client = Arc::new(provider); let contract = StructContract::deploy(client, ()).unwrap().legacy().send().await.unwrap(); diff --git a/ethers-contract/tests/it/contract.rs b/ethers-contract/tests/it/contract.rs index 756210b2..5968b19d 100644 --- a/ethers-contract/tests/it/contract.rs +++ b/ethers-contract/tests/it/contract.rs @@ -13,7 +13,6 @@ mod eth_tests { utils::{keccak256, Anvil}, }; use ethers_derive_eip712::*; - use ethers_middleware::signer::SignerMiddleware; use ethers_providers::{Http, Middleware, PendingTransaction, Provider, StreamExt}; use ethers_signers::{LocalWallet, Signer}; use std::{convert::TryFrom, sync::Arc, time::Duration}; @@ -747,19 +746,17 @@ mod eth_tests { // get ABI and bytecode for the DeriveEip712Test contract let (abi, bytecode) = compile_contract("DeriveEip712Test", "DeriveEip712Test.sol"); - // launch anvil + // launch the network & connect to it let anvil = Anvil::new().spawn(); + let from = anvil.addresses()[0]; + let provider = Provider::try_from(anvil.endpoint()) + .unwrap() + .with_sender(from) + .interval(std::time::Duration::from_millis(10)); + let client = Arc::new(provider); let wallet: LocalWallet = anvil.keys()[0].clone().into(); - let provider = Provider::::try_from(anvil.endpoint()) - .expect("failed to instantiate provider from anvil endpoint") - .interval(Duration::from_millis(10u64)); - - let client = - SignerMiddleware::new_with_provider_chain(provider, wallet.clone()).await.unwrap(); - let client = Arc::new(client); - let factory = ContractFactory::new(abi.clone(), bytecode.clone(), client.clone()); let contract = factory diff --git a/ethers-signers/Cargo.toml b/ethers-signers/Cargo.toml index 84ab59a9..66dffd69 100644 --- a/ethers-signers/Cargo.toml +++ b/ethers-signers/Cargo.toml @@ -44,10 +44,7 @@ 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-derive = { version = "^0.17.0", path = "../ethers-contract/ethers-contract-derive" } 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-signers/src/ledger/app.rs b/ethers-signers/src/ledger/app.rs index fc9e4fe2..5932f0b8 100644 --- a/ethers-signers/src/ledger/app.rs +++ b/ethers-signers/src/ledger/app.rs @@ -250,7 +250,7 @@ impl LedgerEthereum { mod tests { use super::*; use crate::Signer; - use ethers_contract::EthAbiType; + use ethers_contract_derive::EthAbiType; use ethers_core::types::{ transaction::eip712::Eip712, Address, TransactionRequest, I256, U256, }; diff --git a/ethers-signers/src/trezor/app.rs b/ethers-signers/src/trezor/app.rs index 5994c79a..a9e7b555 100644 --- a/ethers-signers/src/trezor/app.rs +++ b/ethers-signers/src/trezor/app.rs @@ -233,7 +233,7 @@ impl TrezorEthereum { mod tests { use super::*; use crate::Signer; - use ethers_contract::EthAbiType; + use ethers_contract_derive::EthAbiType; use ethers_core::types::{ transaction::{ eip2930::{AccessList, AccessListItem},