Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Fix test load_private_device_factor_source_by_id
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX committed Jan 19, 2024
1 parent 0579e3f commit 82f8bbb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,21 @@ impl PrivateHierarchicalDeterministicFactorSource {

impl HasPlaceholder for PrivateHierarchicalDeterministicFactorSource {
fn placeholder() -> Self {
Self::new_with_mnemonic_with_passphrase(
Self::new(
MnemonicWithPassphrase::placeholder(),
WalletClientModel::Iphone,
DeviceFactorSource::placeholder_babylon(),
)
}

fn placeholder_other() -> Self {
Self::new_with_mnemonic_with_passphrase(
MnemonicWithPassphrase::placeholder_other(),
WalletClientModel::Android,
let mwp = MnemonicWithPassphrase::placeholder_other();
Self::new(
mwp.clone(),
DeviceFactorSource::new(
FactorSourceIDFromHash::new_for_device(mwp),
FactorSourceCommon::placeholder_olympia(),
DeviceFactorSourceHint::placeholder_other(),
),
)
}
}
Expand Down
14 changes: 7 additions & 7 deletions profile/src/wallet/wallet_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ mod tests {
sync::atomic::AtomicBool,
};

use __private__::{Mutex, RwLock};

use crate::prelude::*;
pub use pretty_assertions::{assert_eq, assert_ne};
use std::sync::RwLock;

#[test]
fn change_display_name_of_accounts() {
Expand Down Expand Up @@ -362,11 +362,11 @@ mod tests {
let key = SecureStorageKey::DeviceFactorSourceMnemonic {
factor_source_id: private.clone().factor_source.id.clone(),
};
assert!(storage.save_data(key.clone(), data.clone()).is_ok());
assert!(storage.save_data(key.clone(), data).is_ok());

assert_eq!(
wallet.load_private_device_factor_source_by_id(&private.factor_source.id.clone()),
Ok(private.clone())
);
let loaded = wallet
.load_private_device_factor_source_by_id(&private.factor_source.id.clone())
.unwrap();
assert_eq!(loaded, private);
}
}

0 comments on commit 82f8bbb

Please sign in to comment.