fix: merge fix

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

View File

@ -1,11 +1,7 @@
use aes_gcm::{AeadCore, Aes256Gcm, KeyInit, aead::Aead};
use elliptic_curve::PrimeField;
use elliptic_curve::point::AffineCoordinates;
use k256::{AffinePoint, FieldBytes, Scalar};
use k256::{AffinePoint, Scalar};
use log::info;
use rand::{RngCore, rngs::OsRng};
use super::constants_types::{CipherText, Nonce};
use sha2::Digest;
#[derive(Debug)]
///Ephemeral secret key holder. Non-clonable as intended for one-time use. Produces ephemeral public keys. Can produce shared secret for sender.

View File

@ -11,7 +11,7 @@ pub type PublicKey = AffinePoint;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct NSSAUserData {
///Map for all user public accounts
pub_account_signing_keys: HashMap<nssa::Address, nssa::PrivateKey>,
pub pub_account_signing_keys: HashMap<nssa::Address, nssa::PrivateKey>,
///Map for all user private accounts
user_private_accounts: HashMap<nssa::Address, KeyChain>,
}

View File

@ -32,7 +32,6 @@ impl WalletChainStore {
pub(crate) fn insert_account_data(&mut self, acc_data: PersistentAccountData) {
self.user_data
.key_holder
.pub_account_signing_keys
.insert(acc_data.address, acc_data.pub_sign_key);
}

View File

@ -53,7 +53,7 @@ pub fn fetch_persistent_accounts() -> Result<Vec<PersistentAccountData>> {
pub fn produce_data_for_storage(user_data: &NSSAUserData) -> Vec<PersistentAccountData> {
let mut vec_for_storage = vec![];
for (addr, key) in &user_data.key_holder.pub_account_signing_keys {
for (addr, key) in &user_data.pub_account_signing_keys {
vec_for_storage.push(PersistentAccountData {
address: *addr,
pub_sign_key: key.clone(),

View File

@ -111,7 +111,7 @@ impl WalletCore {
)
.unwrap();
let signing_key = self.storage.user_data.get_account_signing_key(&from);
let signing_key = self.storage.user_data.get_pub_account_signing_key(&from);
let Some(signing_key) = signing_key else {
return Err(ExecutionFailureKind::KeyNotFoundError);
@ -228,7 +228,7 @@ 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_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:#?}");