From d51ac5981b5b660f76a88c78f98c7f95c8125375 Mon Sep 17 00:00:00 2001 From: Marek Date: Thu, 16 May 2024 23:56:19 +0200 Subject: [PATCH] Update zebra-network/src/config.rs Co-authored-by: Arya --- zebra-network/src/config.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/zebra-network/src/config.rs b/zebra-network/src/config.rs index 279f051ff2c..63700f4fa18 100644 --- a/zebra-network/src/config.rs +++ b/zebra-network/src/config.rs @@ -768,16 +768,11 @@ impl<'de> Deserialize<'de> for Config { } if let Some(target_difficulty_limit) = target_difficulty_limit { - params_builder = params_builder.with_target_difficulty_limit(U256::from( - <[u8; 32]>::try_from( - hex::decode(target_difficulty_limit).map_err(de::Error::custom)?, - ) - .map_err(|err| { - de::Error::custom(format!( - "hex-encoded target difficulty must be 64 chars: {err:?}" - )) - })?, - )); + params_builder = params_builder.with_target_difficulty_limit( + target_difficulty_limit + .parse::() + .map_err(de::Error::custom)?, + ); } if let Some(disable_pow) = disable_pow {