Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hotfix cast logs subscribe #7688

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/anvil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ alloy-sol-types = { workspace = true, features = ["std"] }
alloy-dyn-abi = { workspace = true, features = ["std", "eip712"] }
alloy-rpc-types.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-provider = { workspace = true, features = ["pubsub"] }
alloy-provider = { workspace = true, features = ["reqwest", "ws", "ipc"] }
alloy-transport.workspace = true
alloy-chains.workspace = true
alloy-genesis.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ alloy-dyn-abi.workspace = true
alloy-json-abi.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-provider = { workspace = true, features = ["pubsub"] }
alloy-provider = { workspace = true, features = ["reqwest", "ws", "ipc"] }
alloy-transport.workspace = true
alloy-rpc-types.workspace = true
alloy-json-rpc.workspace = true
Expand Down
9 changes: 9 additions & 0 deletions crates/cast/bin/cmd/logs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use alloy_dyn_abi::{DynSolType, DynSolValue, Specifier};
use alloy_json_abi::Event;
use alloy_network::AnyNetwork;
use alloy_primitives::{Address, B256};
use alloy_rpc_types::{BlockId, BlockNumberOrTag, Filter, FilterBlockOption, FilterSet, Topic};
use cast::Cast;
Expand Down Expand Up @@ -93,6 +94,14 @@ impl LogsArgs {
return Ok(())
}

// FIXME: this is a hotfix for <https://github.com/foundry-rs/foundry/issues/7682>
// currently the alloy `eth_subscribe` impl does not work with all transports, so we use
// the builtin transport here for now
let url = config.get_rpc_url_or_localhost_http()?;
let provider = alloy_provider::ProviderBuilder::<_, _, AnyNetwork>::default()
.on_builtin(url.as_ref())
.await?;
let cast = Cast::new(&provider);
let mut stdout = io::stdout();
cast.subscribe(filter, &mut stdout, json).await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ alloy-dyn-abi.workspace = true
alloy-json-abi.workspace = true
alloy-primitives = { workspace = true, features = ["serde"] }
alloy-rpc-types.workspace = true
alloy-provider.workspace = true
alloy-provider = { workspace = true, features = ["reqwest", "ws", "ipc"] }
alloy-network.workspace = true
alloy-transport.workspace = true
alloy-signer.workspace = true
Expand Down
Loading