From b1f4755dfeabd92925831a2dbde86beab6644d44 Mon Sep 17 00:00:00 2001 From: Krisztian Pinter Date: Fri, 13 Dec 2024 09:28:57 +0100 Subject: [PATCH] review comment --- toolkit/offchain/src/register.rs | 7 +++++-- toolkit/primitives/domain/src/lib.rs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/toolkit/offchain/src/register.rs b/toolkit/offchain/src/register.rs index 05f994698..20d1e68b7 100644 --- a/toolkit/offchain/src/register.rs +++ b/toolkit/offchain/src/register.rs @@ -181,8 +181,11 @@ pub async fn run_deregister< let validator = crate::scripts_data::registered_candidates_scripts(genesis_utxo)?; let validator_address = validator.address_bech32(ctx.network)?; let all_registration_utxos = ogmios_client.query_utxos(&[validator_address]).await?; - let own_registrations = - get_own_registrations(payment_signing_key.to_pub_key_hash(), stake_ownership_pub_key.clone(), &all_registration_utxos); + let own_registrations = get_own_registrations( + payment_signing_key.to_pub_key_hash(), + stake_ownership_pub_key.clone(), + &all_registration_utxos, + ); if own_registrations.is_empty() { log::info!("✅ Candidate is not registered."); diff --git a/toolkit/primitives/domain/src/lib.rs b/toolkit/primitives/domain/src/lib.rs index 9833c30c2..2b5c7a197 100644 --- a/toolkit/primitives/domain/src/lib.rs +++ b/toolkit/primitives/domain/src/lib.rs @@ -220,14 +220,14 @@ impl MainchainPrivateKey { #[cfg(feature = "std")] pub fn to_pub_key_hash(&self) -> MainchainAddressHash { cardano_serialization_lib::PrivateKey::from_normal_bytes(&self.0) - .expect("impossible") + .expect("Conversion cannot fail on valid MainchainPrivateKey values") .to_public() .hash() .to_bytes() .as_slice() .try_into() .map(MainchainAddressHash) - .expect("impossible") + .expect("Conversion cannot fail as representation is the same") } }