diff --git a/accounts/src/account_core/mod.rs b/accounts/src/account_core/mod.rs index f586019..1926649 100644 --- a/accounts/src/account_core/mod.rs +++ b/accounts/src/account_core/mod.rs @@ -25,7 +25,6 @@ pub struct Account { pub key_holder: AddressKeyHolder, pub address: AccountAddress, pub balance: u64, - pub nonce: u64, pub utxos: HashMap, } @@ -34,7 +33,6 @@ pub struct AccountForSerialization { pub key_holder: AddressKeyHolder, pub address: AccountAddress, pub balance: u64, - pub nonce: u64, pub utxos: HashMap, } @@ -44,7 +42,6 @@ impl From for AccountForSerialization { key_holder: value.key_holder, address: value.address, balance: value.balance, - nonce: value.nonce, utxos: value .utxos .into_iter() @@ -60,7 +57,6 @@ impl From for Account { key_holder: value.key_holder, address: value.address, balance: value.balance, - nonce: value.nonce, utxos: value .utxos .into_iter() @@ -124,14 +120,12 @@ impl Account { let public_key = *key_holder.get_pub_account_signing_key().verifying_key(); let address = address::from_public_key(&public_key); let balance = 0; - let nonce = 0; let utxos = HashMap::new(); Self { key_holder, address, balance, - nonce, utxos, } } @@ -140,14 +134,12 @@ impl Account { let key_holder = AddressKeyHolder::new_os_random(); let public_key = *key_holder.get_pub_account_signing_key().verifying_key(); let address = address::from_public_key(&public_key); - let nonce = 0; let utxos = HashMap::new(); Self { key_holder, address, balance, - nonce, utxos, } } diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 9c17751..875da65 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -112,15 +112,6 @@ impl WalletCore { } } - ///Helperfunction to increment nonces for all given accounts - fn increment_nonces(&mut self, accounts_to_increment_nonces: &[AccountAddress]) { - for acc_addr in accounts_to_increment_nonces { - if let Some(acc) = self.storage.acc_map.get_mut(acc_addr) { - acc.nonce += 1; - } - } - } - ///Dumps all accounts from acc_map at `path` /// ///Currently storing everything in one file @@ -198,7 +189,7 @@ pub async fn execute_subcommand(command: Command) -> Result<()> { let from = produce_account_addr_from_hex(from)?; let to = produce_account_addr_from_hex(to)?; - let mut wallet_core = WalletCore::start_from_config_update_chain(wallet_config).await?; + let wallet_core = WalletCore::start_from_config_update_chain(wallet_config).await?; let res = wallet_core .send_public_native_token_transfer(from, nonce, to, amount) @@ -207,7 +198,6 @@ pub async fn execute_subcommand(command: Command) -> Result<()> { info!("Results of tx send is {res:#?}"); //ToDo: Insert transaction polling logic here - wallet_core.increment_nonces(&[from, to]); let acc_storage_path = wallet_core.store_present_accounts_at_home()?;