This commit is contained in:
Oleksandr Pravdyvyi 2025-09-08 15:23:32 +03:00
parent 4837413989
commit 23e79d3e17
No known key found for this signature in database
GPG Key ID: 9F8955C63C443871
4 changed files with 13 additions and 6 deletions

View File

@ -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;

View File

@ -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};

View File

@ -46,11 +46,15 @@ impl NSSAUserData {
accounts_key_chains: HashMap<nssa::Address, KeyChain>,
) -> Result<Self> {
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 {

View File

@ -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:#?}");