diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7eb5e193..f53c3b7b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -54,25 +54,10 @@ jobs: | grep refs/heads/main \ | cut -f 1) - # Fetch the latest commit hash of the `main` branch from the Alloy Core repository - export latest_alloy_core_commit=$(git ls-remote https://github.com/alloy-rs/core.git \ - | grep refs/heads/main \ - | cut -f 1) - # Use the commit hash to update the rev in Cargo.toml sed -i 's/\(alloy = { git = "https:\/\/github.com\/alloy-rs\/alloy", rev = "\)[^"]*/\1'"$latest_alloy_commit"'/' \ Cargo.toml - # Temporary patch until https://github.com/alloy-rs/alloy/pull/392 is resolved - sed -i 's/\(alloy-rpc-client = { git = "https:\/\/github.com\/alloy-rs\/alloy", rev = "\)[^"]*/\1'"$latest_alloy_commit"'/' \ - examples/providers/Cargo.toml - sed -i 's/\(alloy-provider = { git = "https:\/\/github.com\/alloy-rs\/alloy", rev = "\)[^"]*/\1'"$latest_alloy_commit"'/' \ - examples/providers/Cargo.toml - sed -i 's/\(alloy-rpc-client = { git = "https:\/\/github.com\/alloy-rs\/alloy", rev = "\)[^"]*/\1'"$latest_alloy_commit"'/' \ - examples/subscriptions/Cargo.toml - sed -i 's/\(alloy-provider = { git = "https:\/\/github.com\/alloy-rs\/alloy", rev = "\)[^"]*/\1'"$latest_alloy_commit"'/' \ - examples/subscriptions/Cargo.toml - # Update to the latest commit cargo update diff --git a/Cargo.toml b/Cargo.toml index bbf30525..424a2993 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,41 +81,26 @@ unnecessary_struct_initialization = "allow" use_self = "allow" [workspace.dependencies] -alloy = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af", features = [ - # "dyn-abi", - # "json-abi", - # "json", - "sol-types", - # "rlp", - # "serde", +alloy = { git = "https://github.com/alloy-rs/alloy", rev = "27d5ba9", features = [ "contract", - # "consensus", - # "eips", "network", - # "genesis", "node-bindings", "providers", - "rpc", - # "json-rpc", + "provider-http", + "provider-ipc", + "provider-ws", "rpc-client", - # "rpc-types", + "rpc-client-ipc", + "rpc-client-ws", "rpc-types-eth", - # "rpc-types-engine", "rpc-types-trace", "signers", - # "signer-aws", - # "signer-gcp", "signer-keystore", "signer-ledger", "signer-mnemonic", "signer-trezor", "signer-wallet", "signer-yubihsm", - "transports", - "transport-http", - "transport-ipc", - "transport-ws", - "pubsub", ] } # async diff --git a/examples/providers/Cargo.toml b/examples/providers/Cargo.toml index b2661502..b30e6fbc 100644 --- a/examples/providers/Cargo.toml +++ b/examples/providers/Cargo.toml @@ -14,22 +14,7 @@ workspace = true [dev-dependencies] alloy.workspace = true -# Temp dependency fix to enable relevant features - Ref: https://github.com/alloy-rs/examples/pull/3#discussion_r1537842062 -alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af", features = [ - "pubsub", - "ipc", - "ws", -] } -alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af", features = [ - "pubsub", - "ws", - "ipc", -] } -alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af" } - -alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af" } -alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af" } eyre.workspace = true futures-util = "0.3" tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } diff --git a/examples/providers/examples/connect_builtin.rs b/examples/providers/examples/connect_builtin.rs index 999b3757..2e99e020 100644 --- a/examples/providers/examples/connect_builtin.rs +++ b/examples/providers/examples/connect_builtin.rs @@ -1,10 +1,12 @@ //! Example of using the `RootProvider::connect_builtin` to create a provider //! from a connection string. The connection string can be a HTTP, WS or IPC endpoint. -use alloy::node_bindings::Anvil; -use alloy_network::Ethereum; -use alloy_provider::{Provider, RootProvider}; -use alloy_transport::BoxTransport; +use alloy::{ + network::Ethereum, + node_bindings::Anvil, + providers::{Provider, RootProvider}, + transports::BoxTransport, +}; use eyre::Result; use futures_util::StreamExt; diff --git a/examples/providers/examples/ipc.rs b/examples/providers/examples/ipc.rs index d5dccbbd..2acab35c 100644 --- a/examples/providers/examples/ipc.rs +++ b/examples/providers/examples/ipc.rs @@ -1,9 +1,11 @@ //! Example of using the IPC provider to get the latest block number. -use alloy_network::Ethereum; -use alloy_provider::{Provider, RootProvider}; -use alloy_rpc_client::RpcClient; -use alloy_transport_ipc::IpcConnect; +use alloy::{ + network::Ethereum, + providers::{Provider, RootProvider}, + rpc::client::RpcClient, + transports::ipc::IpcConnect, +}; use eyre::Result; #[tokio::main] diff --git a/examples/providers/examples/ws.rs b/examples/providers/examples/ws.rs index 2da07e91..1a880ec1 100644 --- a/examples/providers/examples/ws.rs +++ b/examples/providers/examples/ws.rs @@ -1,10 +1,10 @@ //! Example of using the WS provider to subscribe to new blocks. -// Temp Fix -use alloy_network::Ethereum; -use alloy_provider::{Provider, RootProvider}; -use alloy_rpc_client::{RpcClient, WsConnect}; -// +use alloy::{ + network::Ethereum, + providers::{Provider, RootProvider}, + rpc::client::{RpcClient, WsConnect}, +}; use eyre::Result; use futures_util::StreamExt; diff --git a/examples/providers/examples/ws_with_auth.rs b/examples/providers/examples/ws_with_auth.rs index 29fe2c8c..b8f2f9c2 100644 --- a/examples/providers/examples/ws_with_auth.rs +++ b/examples/providers/examples/ws_with_auth.rs @@ -1,11 +1,11 @@ //! Example of using the WS provider with auth to subscribe to new blocks. -// Temp Fix -use alloy_network::Ethereum; -use alloy_provider::{Provider, RootProvider}; -use alloy_rpc_client::{RpcClient, WsConnect}; -use alloy_transport::Authorization; -// +use alloy::{ + network::Ethereum, + providers::{Provider, RootProvider}, + rpc::client::{RpcClient, WsConnect}, + transports::Authorization, +}; use eyre::Result; use futures_util::StreamExt; diff --git a/examples/subscriptions/Cargo.toml b/examples/subscriptions/Cargo.toml index 9c112b73..7b9684b8 100644 --- a/examples/subscriptions/Cargo.toml +++ b/examples/subscriptions/Cargo.toml @@ -14,23 +14,6 @@ workspace = true [dev-dependencies] alloy.workspace = true -# Temp fix for enabling features. Ref: https://github.com/alloy-rs/examples/pull/3/#discussion_r1537842062 -alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af", features = [ - "pubsub", - "ws", -] } -alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "8acf6af", features = [ - "pubsub", -] } -# alloy-contract.workspace = true -# alloy-network.workspace = true -# alloy-node-bindings.workspace = true -# alloy-provider = { workspace = true, features = ["pubsub", "ws"] } -# alloy-pubsub.workspace = true -# alloy-primitives.workspace = true -# alloy-rpc-client.workspace = true -# alloy-rpc-types.workspace = true -# alloy-sol-types = { workspace = true } eyre.workspace = true futures-util = "0.3" diff --git a/examples/subscriptions/examples/event_multiplexer.rs b/examples/subscriptions/examples/event_multiplexer.rs index 9b926442..05bb9b63 100644 --- a/examples/subscriptions/examples/event_multiplexer.rs +++ b/examples/subscriptions/examples/event_multiplexer.rs @@ -1,8 +1,13 @@ //! Example of multiplexing the watching of event logs. -use alloy::{node_bindings::Anvil, primitives::I256, sol, sol_types::SolEvent}; -use alloy_provider::ProviderBuilder; -use alloy_rpc_client::{RpcClient, WsConnect}; +use alloy::{ + node_bindings::Anvil, + primitives::I256, + providers::ProviderBuilder, + rpc::client::{RpcClient, WsConnect}, + sol, + sol_types::SolEvent, +}; use eyre::Result; use futures_util::StreamExt; use std::str::FromStr; diff --git a/examples/subscriptions/examples/subscribe_blocks.rs b/examples/subscriptions/examples/subscribe_blocks.rs index 659de947..cd1e32ef 100644 --- a/examples/subscriptions/examples/subscribe_blocks.rs +++ b/examples/subscriptions/examples/subscribe_blocks.rs @@ -1,8 +1,10 @@ //! Example of subscribing to blocks and watching block headers by polling. -use alloy::node_bindings::Anvil; -use alloy_provider::{Provider, ProviderBuilder}; -use alloy_rpc_client::RpcClient; +use alloy::{ + node_bindings::Anvil, + providers::{Provider, ProviderBuilder}, + rpc::client::{RpcClient, WsConnect}, +}; use eyre::Result; use futures_util::{stream, StreamExt}; @@ -13,7 +15,7 @@ async fn main() -> Result<()> { let anvil = Anvil::new().block_time(1).try_spawn()?; // Create a provider. - let ws = alloy_rpc_client::WsConnect::new(anvil.ws_endpoint()); + let ws = WsConnect::new(anvil.ws_endpoint()); let provider = ProviderBuilder::new().on_client(RpcClient::connect_pubsub(ws).await?); // Subscribe to blocks. diff --git a/examples/subscriptions/examples/watch_contract_event.rs b/examples/subscriptions/examples/watch_contract_event.rs index dcb09d09..f7f3cd9a 100644 --- a/examples/subscriptions/examples/watch_contract_event.rs +++ b/examples/subscriptions/examples/watch_contract_event.rs @@ -1,8 +1,11 @@ //! Example of subscribing to blocks and watching contract events by WebSocket subscription. -use alloy::{node_bindings::Anvil, sol}; -use alloy_provider::ProviderBuilder; -use alloy_rpc_client::RpcClient; +use alloy::{ + node_bindings::Anvil, + providers::ProviderBuilder, + rpc::client::{RpcClient, WsConnect}, + sol, +}; use eyre::Result; use futures_util::StreamExt; @@ -36,8 +39,7 @@ async fn main() -> Result<()> { let anvil = Anvil::new().block_time(1).try_spawn()?; // Create a WebSocket provider. - let ws_rpc_url = anvil.ws_endpoint(); - let ws = alloy_rpc_client::WsConnect::new(ws_rpc_url); + let ws = WsConnect::new(anvil.ws_endpoint()); let provider = ProviderBuilder::new().on_client(RpcClient::connect_pubsub(ws).await?); // Deploy the `Counter` contract.