From 0ed5ba4fb4dc6bfd7e9511b2e13f1c59139785bd Mon Sep 17 00:00:00 2001 From: esraa Date: Sat, 6 Jun 2026 12:09:09 +0300 Subject: [PATCH] Fix downstream difficulty default export --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/config.rs | 6 ++---- src/translator/mod.rs | 1 + tests/library_init.rs | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07580b9b..6341d7e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1112,7 +1112,7 @@ dependencies = [ [[package]] name = "dmnd-client" -version = "0.3.28" +version = "0.3.29" dependencies = [ "async-recursion", "axum", diff --git a/Cargo.toml b/Cargo.toml index a7cad6dc..788b2bb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dmnd-client" -version = "0.3.28" +version = "0.3.29" edition = "2021" [lib] diff --git a/src/config.rs b/src/config.rs index 9513a05c..417f32a0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -359,7 +359,7 @@ and make that test pass." 120_000, 0, DEFAULT_SV1_HASHPOWER, - crate::translator::downstream::diff_management::NON_LOCAL_DOWNSTREAM_MIN_DIFFICULTY, + crate::translator::NON_LOCAL_DOWNSTREAM_MIN_DIFFICULTY, "info".to_string(), "off".to_string(), false, @@ -723,9 +723,7 @@ and make that test pass." .ok() .and_then(|s| parse_downstream_min_difficulty(&s).ok()) }) - .unwrap_or( - crate::translator::downstream::diff_management::NON_LOCAL_DOWNSTREAM_MIN_DIFFICULTY, - ); + .unwrap_or(crate::translator::NON_LOCAL_DOWNSTREAM_MIN_DIFFICULTY); println!("Using downstream minimum difficulty: {downstream_min_difficulty}"); let listening_addr = args.listening_addr.or(config.listening_addr).or_else(|| { diff --git a/src/translator/mod.rs b/src/translator/mod.rs index 5032e7b7..adcaeb74 100644 --- a/src/translator/mod.rs +++ b/src/translator/mod.rs @@ -1,4 +1,5 @@ pub(crate) mod downstream; +pub(crate) use downstream::diff_management::NON_LOCAL_DOWNSTREAM_MIN_DIFFICULTY; mod error; mod proxy; diff --git a/tests/library_init.rs b/tests/library_init.rs index c7a55bf5..3b18ffc7 100644 --- a/tests/library_init.rs +++ b/tests/library_init.rs @@ -110,7 +110,7 @@ async fn library_init_sv2_setup_connection() { 120_000, 0, 100_000_000_000_000.0, - 131_072.0, + 0.0, "info".to_string(), "off".to_string(), false,