Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
add unit test mixing accounts and personas creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX committed Oct 9, 2024
1 parent ceaee8b commit 9f24311
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,28 @@ async fn adding_personas_and_clearing_cache_in_between() {
assert_eq!(os.profile_snapshot().get_personas().len(), 2);
}

#[actix_rt::test]
async fn add_account_and_personas_mixed() {
let (mut os, _) = SargonOS::with_bdfs().await;
assert!(os.profile_snapshot().get_personas().is_empty());
assert!(os.profile_snapshot().get_accounts().is_empty());

let (_, stats) = os.new_mainnet_persona_with_bdfs("Batman").await.unwrap();
assert!(stats.debug_was_derived.is_empty());

let (_, stats) = os.new_mainnet_account_with_bdfs("alice").await.unwrap();
assert!(stats.debug_was_derived.is_empty());

let (_, stats) = os.new_mainnet_persona_with_bdfs("Satoshi").await.unwrap();
assert!(stats.debug_was_derived.is_empty());

let (_, stats) = os.new_mainnet_account_with_bdfs("bob").await.unwrap();
assert!(stats.debug_was_derived.is_empty());

assert_eq!(os.profile_snapshot().get_personas().len(), 2);
assert_eq!(os.profile_snapshot().get_accounts().len(), 2);
}

#[actix_rt::test]
async fn adding_accounts_different_networks_different_factor_sources() {
let mut os = SargonOS::new();
Expand Down

0 comments on commit 9f24311

Please sign in to comment.