Skip to content
New issue

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

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

Already on GitHub? # to your account

[pallet-revive] eth-rpc-tester quick fixes #7818

Merged
merged 7 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
7 changes: 7 additions & 0 deletions prdoc/pr_7818.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: '[pallet-revive] eth-rpc-tester quick fixes'
doc:
- audience: Runtime Dev
description: 'Small tweaks to the eth-rpc-tester bin
crates:
- name: pallet-revive-eth-rpc
bump: patch
12 changes: 8 additions & 4 deletions substrate/frame/revive/rpc/src/eth-rpc-tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ pub struct CliCommand {
pub rpc_url: String,

/// The parity docker image e.g eth-rpc:master-fb2e414f
#[clap(long, default_value = "eth-rpc:master-fb2e414f")]
docker_image: String,
/// When not specified, no eth-rpc docker image is started
/// and the test runs against the provided `rpc_url` directly.
#[clap(long)]
docker_image: Option<String>,

/// The docker binary
/// Either docker or podman
Expand All @@ -48,9 +50,10 @@ pub struct CliCommand {
async fn main() -> anyhow::Result<()> {
let CliCommand { docker_bin, rpc_url, docker_image, .. } = CliCommand::parse();

if std::env::var("SKIP_DOCKER").is_ok() {
let Some(docker_image) = docker_image else {
println!("No docker image specified, using: {rpc_url:?}");
return test_eth_rpc(&rpc_url).await;
}
};

let mut docker_process = start_docker(&docker_bin, &docker_image)?;
let stderr = docker_process.stderr.take().unwrap();
Expand Down Expand Up @@ -129,6 +132,7 @@ async fn test_eth_rpc(rpc_url: &str) -> anyhow::Result<()> {

println!("Account:");
println!("- address: {:?}", account.address());
println!("- substrate address: {}", account.substrate_account());
let client = Arc::new(HttpClientBuilder::default().build(rpc_url)?);

let nonce = client.get_transaction_count(account.address(), BlockTag::Latest.into()).await?;
Expand Down
Loading