From 23e79d3e17dd743efd50696b9d7584008d86356f Mon Sep 17 00:00:00 2001 From: Oleksandr Pravdyvyi Date: Mon, 8 Sep 2025 15:23:32 +0300 Subject: [PATCH] fix: fmt --- key_protocol/src/key_management/mod.rs | 4 ++-- key_protocol/src/key_management/secret_holders.rs | 2 +- key_protocol/src/key_protocol_core/mod.rs | 8 ++++++-- wallet/src/lib.rs | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/key_protocol/src/key_management/mod.rs b/key_protocol/src/key_management/mod.rs index 9fc3f06..ea337dd 100644 --- a/key_protocol/src/key_management/mod.rs +++ b/key_protocol/src/key_management/mod.rs @@ -1,4 +1,4 @@ -use aes_gcm::{aead::Aead, Aes256Gcm, KeyInit}; +use aes_gcm::{Aes256Gcm, KeyInit, aead::Aead}; use common::merkle_tree_public::TreeHashType; use elliptic_curve::group::GroupEncoding; use elliptic_curve::point::AffineCoordinates; @@ -6,7 +6,7 @@ use k256::AffinePoint; use log::info; use secret_holders::{PrivateKeyHolder, SeedHolder, TopSecretKeyHolder}; use serde::{Deserialize, Serialize}; -use sha2::{digest::FixedOutput, Digest}; +use sha2::{Digest, digest::FixedOutput}; use types::{CipherText, Nonce}; use crate::key_protocol_core::PublicKey; diff --git a/key_protocol/src/key_management/secret_holders.rs b/key_protocol/src/key_management/secret_holders.rs index 9387747..b6784cd 100644 --- a/key_protocol/src/key_management/secret_holders.rs +++ b/key_protocol/src/key_management/secret_holders.rs @@ -2,7 +2,7 @@ use bip39::Mnemonic; use common::merkle_tree_public::TreeHashType; use elliptic_curve::PrimeField; use k256::{AffinePoint, Scalar}; -use rand::{rngs::OsRng, RngCore}; +use rand::{RngCore, rngs::OsRng}; use serde::{Deserialize, Serialize}; use sha2::{Digest, digest::FixedOutput}; diff --git a/key_protocol/src/key_protocol_core/mod.rs b/key_protocol/src/key_protocol_core/mod.rs index 167f8fe..58f60ce 100644 --- a/key_protocol/src/key_protocol_core/mod.rs +++ b/key_protocol/src/key_protocol_core/mod.rs @@ -46,11 +46,15 @@ impl NSSAUserData { accounts_key_chains: HashMap, ) -> Result { if !Self::valid_public_key_transaction_pairing_check(&accounts_keys) { - anyhow::bail!("Key transaction pairing check not satisfied, there is addresses, which is not derived from keys"); + anyhow::bail!( + "Key transaction pairing check not satisfied, there is addresses, which is not derived from keys" + ); } if !Self::valid_private_key_transaction_pairing_check(&accounts_key_chains) { - anyhow::bail!("Key transaction pairing check not satisfied, there is addresses, which is not derived from keys"); + anyhow::bail!( + "Key transaction pairing check not satisfied, there is addresses, which is not derived from keys" + ); } Ok(Self { diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index f9c5f24..5a24933 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -228,7 +228,10 @@ pub async fn execute_subcommand(command: Command) -> Result<()> { Command::RegisterAccount {} => { let addr = wallet_core.create_new_account(); - let key = wallet_core.storage.user_data.get_pub_account_signing_key(&addr); + let key = wallet_core + .storage + .user_data + .get_pub_account_signing_key(&addr); info!("Generated new account with addr {addr:#?}"); info!("With key {key:#?}");