From 02f686a28439a6f7a1801159746a0f1dc3e3f3e3 Mon Sep 17 00:00:00 2001 From: "rearden-grok[bot]" <317016512+rearden-grok[bot]@users.noreply.github.com> Date: Thu, 15 Oct 2026 10:00:55 -0700 Subject: [PATCH] test: fold getnetworkhashps help onto the genesis RPC journey rpc_regtest_from_genesis asks help for getnetworkhashps and checks the text names chainwork. The small unit that only called method_help is deleted. --- crates/rbitcoin-rpc/src/methods_tests.rs | 9 --------- crates/rbitcoin-rpc/src/regtest_chain_ops_journey.rs | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/rbitcoin-rpc/src/methods_tests.rs b/crates/rbitcoin-rpc/src/methods_tests.rs index 1c5eacc722..e75b200dae 100644 --- a/crates/rbitcoin-rpc/src/methods_tests.rs +++ b/crates/rbitcoin-rpc/src/methods_tests.rs @@ -462,15 +462,6 @@ fn blockchain_empty_store() { let _ = std::fs::remove_dir_all(&dir); } -#[test] -fn getnetworkhashps_help_names_chainwork() { - let h = super::method_help("getnetworkhashps"); - assert!( - h.to_lowercase().contains("chainwork") && !h.contains("Dummy 2-work"), - "hashrate help must name chainwork, not dummy 2-work: {h}" - ); -} - fn chainwork_f64(hex: &str) -> f64 { let b = rbitcoin_primitives::hex_decode(hex).unwrap(); b.iter().fold(0.0, |a, x| a * 256.0 + f64::from(*x)) diff --git a/crates/rbitcoin-rpc/src/regtest_chain_ops_journey.rs b/crates/rbitcoin-rpc/src/regtest_chain_ops_journey.rs index 88adb772ea..eab1f1f603 100644 --- a/crates/rbitcoin-rpc/src/regtest_chain_ops_journey.rs +++ b/crates/rbitcoin-rpc/src/regtest_chain_ops_journey.rs @@ -72,6 +72,12 @@ fn regrind(block: &mut Block) { #[test] fn rpc_regtest_from_genesis() { let (ctx, dir, hub) = ctx_regtest_hub(); + let help = dispatch(&ctx, "help", vec![json!("getnetworkhashps")]).unwrap(); + let h = help.as_str().expect("help is a string"); + assert!( + h.to_lowercase().contains("chainwork") && !h.contains("Dummy 2-work"), + "hashrate help must name chainwork, not dummy 2-work: {h}" + ); let (addr, p2wpkh) = p2wpkh_regtest(); let store = dir.join("store"); chain_ops_at_genesis(&ctx, &hub, &store);