diff --git a/Cargo.lock b/Cargo.lock index 0bbc7d276744..fafe9ec6183f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,6 +125,7 @@ dependencies = [ "alloy-primitives", "serde", "serde_json", + "thiserror", ] [[package]] @@ -134,9 +135,6 @@ dependencies = [ "alloy-json-rpc", "alloy-primitives", "alloy-rlp", - "alloy-transports", - "pin-project", - "tower", ] [[package]] @@ -167,19 +165,16 @@ dependencies = [ name = "alloy-providers" version = "0.1.0" dependencies = [ - "alloy-json-rpc", "alloy-networks", "alloy-primitives", + "alloy-rpc-client", "alloy-rpc-types", - "alloy-transports", + "alloy-transport", + "alloy-transport-http", "async-trait", "auto_impl", - "futures-util", - "once_cell", "reqwest", "serde", - "serde_json", - "serial_test", "thiserror", ] @@ -206,20 +201,34 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "alloy-rpc-client" +version = "0.1.0" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "alloy-transport-http", + "futures", + "pin-project", + "reqwest", + "serde_json", + "tower", + "tracing", + "url", +] + [[package]] name = "alloy-rpc-types" version = "0.1.0" dependencies = [ "alloy-primitives", "alloy-rlp", - "bytes", "itertools 0.11.0", "jsonrpsee-types", "serde", "serde_json", "serde_with", "thiserror", - "url", ] [[package]] @@ -259,15 +268,11 @@ dependencies = [ ] [[package]] -name = "alloy-transports" +name = "alloy-transport" version = "0.1.0" dependencies = [ "alloy-json-rpc", "base64 0.21.5", - "futures-channel", - "hyper", - "pin-project", - "reqwest", "serde", "serde_json", "thiserror", @@ -277,6 +282,18 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "alloy-transport-http" +version = "0.1.0" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest", + "serde_json", + "tower", + "url", +] + [[package]] name = "ammonia" version = "3.3.0" @@ -366,7 +383,7 @@ dependencies = [ "alloy-primitives", "alloy-providers", "alloy-rpc-types", - "alloy-transports", + "alloy-transport", "anvil-core", "anvil-rpc", "anvil-server", @@ -2875,7 +2892,8 @@ dependencies = [ "alloy-json-abi", "alloy-primitives", "alloy-providers", - "alloy-transports", + "alloy-transport", + "alloy-transport-http", "async-trait", "auto_impl", "clap", @@ -3033,7 +3051,7 @@ dependencies = [ "alloy-providers", "alloy-rpc-types", "alloy-sol-types", - "alloy-transports", + "alloy-transport", "const-hex", "ethers", "ethers-contract", diff --git a/Cargo.toml b/Cargo.toml index c7d62bc42307..ca6196464bed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -157,9 +157,10 @@ alloy-dyn-abi = "0.4.1" alloy-json-abi = "0.4.1" alloy-sol-types = "0.4.1" syn-solidity = "0.4.1" -alloy-providers = { path = "../alloy/crates/providers" } -alloy-transports = { path = "../alloy/crates/transports" } -alloy-rpc-types = { path = "../alloy/crates/rpc-types" } +alloy-providers = { path = "../../alloy-rs/alloy/crates/providers" } +alloy-transport = { path = "../../alloy-rs/alloy/crates/transport" } +alloy-transport-http = { path = "../../alloy-rs/alloy/crates/transport-http" } +alloy-rpc-types = { path = "../../alloy-rs/alloy/crates/rpc-types" } alloy-chains = "0.1.2" alloy-rlp = "0.3.3" diff --git a/crates/anvil/Cargo.toml b/crates/anvil/Cargo.toml index b74766da3b8a..537484387151 100644 --- a/crates/anvil/Cargo.toml +++ b/crates/anvil/Cargo.toml @@ -37,7 +37,7 @@ memory-db = "0.29" alloy-primitives = { workspace = true, features = ["serde"] } alloy-rpc-types.workspace = true alloy-providers.workspace = true -alloy-transports.workspace = true +alloy-transport.workspace = true # axum related axum.workspace = true diff --git a/crates/anvil/tests/it/genesis.rs b/crates/anvil/tests/it/genesis.rs index 17c1ebabf24b..31521281e670 100644 --- a/crates/anvil/tests/it/genesis.rs +++ b/crates/anvil/tests/it/genesis.rs @@ -2,9 +2,9 @@ use std::str::FromStr; -use anvil::{genesis::Genesis, spawn, NodeConfig}; -use alloy_providers::provider::TempProvider; use alloy_primitives::{Address, U256, U64}; +use alloy_providers::provider::TempProvider; +use anvil::{genesis::Genesis, spawn, NodeConfig}; #[tokio::test(flavor = "multi_thread")] async fn can_apply_genesis() { diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 2e4c26281ce7..bf0d93bf1c97 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -24,7 +24,8 @@ alloy-dyn-abi = { workspace = true, features = ["arbitrary", "eip712"] } alloy-json-abi.workspace = true alloy-primitives = { workspace = true, features = ["serde", "getrandom", "arbitrary", "rlp"] } alloy-providers.workspace = true -alloy-transports.workspace = true +alloy-transport.workspace = true +alloy-transport-http.workspace = true async-trait = "0.1" auto_impl = "1.1.0" diff --git a/crates/common/src/provider.rs b/crates/common/src/provider.rs index 112cbe21f663..d6d0ac1385c3 100644 --- a/crates/common/src/provider.rs +++ b/crates/common/src/provider.rs @@ -3,7 +3,8 @@ use crate::{ALCHEMY_FREE_TIER_CUPS, REQUEST_TIMEOUT}; use alloy_primitives::U256; use alloy_providers::provider::{Provider, TempProvider}; -use alloy_transports::{Authorization, BoxTransport, Http, Transport}; +use alloy_transport::{Authorization, BoxTransport, Transport}; +use alloy_transport_http::Http; use ethers_middleware::gas_oracle::{GasCategory, GasOracle, Polygon}; use ethers_providers::{JwtAuth, JwtKey}; use eyre::{Result, WrapErr}; diff --git a/crates/evm/core/Cargo.toml b/crates/evm/core/Cargo.toml index 464db66843d9..d7f0a8870c7d 100644 --- a/crates/evm/core/Cargo.toml +++ b/crates/evm/core/Cargo.toml @@ -32,7 +32,7 @@ revm = { workspace = true, default-features = false, features = [ "arbitrary", ] } alloy-providers = { workspace = true } -alloy-transports = { workspace = true } +alloy-transport = { workspace = true } alloy-rpc-types = { workspace = true } ethers = { workspace = true, features = ["ethers-solc"] } diff --git a/crates/evm/core/src/fork/multi.rs b/crates/evm/core/src/fork/multi.rs index 8b00a3a00c57..7eab0cf15e8e 100644 --- a/crates/evm/core/src/fork/multi.rs +++ b/crates/evm/core/src/fork/multi.rs @@ -5,7 +5,7 @@ use crate::fork::{BackendHandler, BlockchainDb, BlockchainDbMeta, CreateFork, SharedBackend}; use alloy_providers::provider::Provider; -use alloy_transports::BoxTransport; +use alloy_transport::BoxTransport; use ethers::types::BlockNumber; use foundry_common::ProviderBuilder; use foundry_config::Config; diff --git a/crates/test-utils/src/script.rs b/crates/test-utils/src/script.rs index 4ad709aed5a5..15f11004b9cd 100644 --- a/crates/test-utils/src/script.rs +++ b/crates/test-utils/src/script.rs @@ -183,8 +183,13 @@ impl ScriptTester { address_indexes: &[(Address, u32)], ) -> &mut Self { for (address, expected_increment) in address_indexes { - let nonce = - self.provider.as_ref().unwrap().get_transaction_count(*address, None).await.unwrap(); + let nonce = self + .provider + .as_ref() + .unwrap() + .get_transaction_count(*address, None) + .await + .unwrap(); let prev_nonce = self.address_nonces.get(address).unwrap(); assert_eq!(nonce, (prev_nonce + U256::from(*expected_increment)));