This commit is contained in:
Jon Häggblad
2023-09-21 13:43:31 +02:00
committed by fmtabbara
parent 4f4cb83456
commit 23d11ce523
2 changed files with 6 additions and 7 deletions
@@ -560,12 +560,7 @@ pub async fn rename_account_for_password(
let login_id = wallet_storage::LoginId::new(DEFAULT_LOGIN_ID.to_string());
let account_id = wallet_storage::AccountId::new(account_id.to_string());
let new_account_id = wallet_storage::AccountId::new(new_account_id.to_string());
wallet_storage::rename_account_in_login(
&login_id,
&account_id,
&new_account_id,
&password,
)?;
wallet_storage::rename_account_in_login(&login_id, &account_id, &new_account_id, &password)?;
// Load from storage to reset the internal tuari state
let stored_login = wallet_storage::load_existing_login(&login_id, &password)?;
@@ -278,7 +278,11 @@ impl MultipleAccounts {
Ok(())
}
pub(crate) fn rename(&mut self, id: &AccountId, new_id: &AccountId) -> Result<(), BackendError> {
pub(crate) fn rename(
&mut self,
id: &AccountId,
new_id: &AccountId,
) -> Result<(), BackendError> {
if self.get_account(new_id).is_some() {
return Err(BackendError::WalletAccountIdAlreadyExistsInWalletLogin);
}