From cd456d282c27ea38a715d9079027b3b8f2432d8c Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 19 Dec 2024 13:26:39 +0100 Subject: [PATCH] fixes --- .../agnostic_paths/derivation_preset.rs | 21 +++- .../quantified_derivation_preset.rs | 100 ++++++++++++------ .../factor_instances_provider_unit_tests.rs | 2 - .../factor_instances_provider_outcome.rs | 6 +- ...ernal_factor_instances_provider_outcome.rs | 12 +-- ...r_instances_provider_outcome_for_factor.rs | 34 ++++-- ...curify_entity_factor_instances_provider.rs | 70 ++++-------- .../matrices/matrix_of_factor_instances.rs | 25 +---- .../system/sargon_os/sargon_os_accounts.rs | 69 +++++------- .../src/types/samples/account_samples.rs | 2 +- .../src/types/samples/persona_samples.rs | 2 +- 11 files changed, 164 insertions(+), 179 deletions(-) diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/derivation_preset.rs b/crates/sargon/src/factor_instances_provider/agnostic_paths/derivation_preset.rs index 5d35861bd..6e662864d 100644 --- a/crates/sargon/src/factor_instances_provider/agnostic_paths/derivation_preset.rs +++ b/crates/sargon/src/factor_instances_provider/agnostic_paths/derivation_preset.rs @@ -76,7 +76,6 @@ impl DerivationPreset { } } - /// Selects a `DerivationPreset` for MFA based on `CAP26EntityKind`, /// i.e. either `DerivationPreset::AccountRola` or `DerivationPreset::IdentityRola`. pub fn rola_entity_kind(entity_kind: CAP26EntityKind) -> Self { @@ -171,13 +170,25 @@ mod tests { #[test] fn test_mfa_entity_kind() { - assert_eq!(SUT::mfa_entity_kind(CAP26EntityKind::Account), SUT::AccountMfa); - assert_eq!(SUT::mfa_entity_kind(CAP26EntityKind::Identity), SUT::IdentityMfa); + assert_eq!( + SUT::mfa_entity_kind(CAP26EntityKind::Account), + SUT::AccountMfa + ); + assert_eq!( + SUT::mfa_entity_kind(CAP26EntityKind::Identity), + SUT::IdentityMfa + ); } #[test] fn test_rola_entity_kind() { - assert_eq!(SUT::rola_entity_kind(CAP26EntityKind::Account), SUT::AccountRola); - assert_eq!(SUT::rola_entity_kind(CAP26EntityKind::Identity), SUT::IdentityRola); + assert_eq!( + SUT::rola_entity_kind(CAP26EntityKind::Account), + SUT::AccountRola + ); + assert_eq!( + SUT::rola_entity_kind(CAP26EntityKind::Identity), + SUT::IdentityRola + ); } } diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/quantified_derivation_preset.rs b/crates/sargon/src/factor_instances_provider/agnostic_paths/quantified_derivation_preset.rs index 03b19015c..6afd21b29 100644 --- a/crates/sargon/src/factor_instances_provider/agnostic_paths/quantified_derivation_preset.rs +++ b/crates/sargon/src/factor_instances_provider/agnostic_paths/quantified_derivation_preset.rs @@ -22,8 +22,27 @@ impl QuantifiedDerivationPreset { } } - pub fn mfa_for_entities( + /// Returns a the QuantifiedDerivationPresets needed to securify the `addresses_of_entities`, including + /// a new Authentication Signing factor instance for each entity. Will return + /// the `Account` variant of each DerivationPreset for each Account in `addresses_of_entities` + /// and the `Identity` variant of each DerivationPreset for each Persona in `addresses_of_entities`. + pub fn securifying_unsecurified_entities( addresses_of_entities: &IndexSet, + ) -> IdentifiedVecOf { + Self::mfa_for_entities(addresses_of_entities, true) + } + + /// Returns a the QuantifiedDerivationPresets needed to securify the `addresses_of_entities`, Will return + /// the `Account` variant of each DerivationPreset for each Account in `addresses_of_entities` + /// and the `Identity` variant of each DerivationPreset for each Persona in `addresses_of_entities`. + /// + /// if `include_rola_key_for_each_entity` is `true` a ROLA key for each entity will be included. + /// Typically we only set `include_rola_key_for_each_entity` to `true` for securifying + /// unsecurified entities. For already securified entities we might not + /// need to change the ROLA key. + fn mfa_for_entities( + addresses_of_entities: &IndexSet, + include_rola_key_for_each_entity: bool, ) -> IdentifiedVecOf { let account_addresses = addresses_of_entities .iter() @@ -36,44 +55,55 @@ impl QuantifiedDerivationPreset { match (account_addresses.is_empty(), identity_addresses.is_empty()) { (true, true) => IdentifiedVecOf::new(), // weird! - (true, false) => IdentifiedVecOf::from_iter([ - Self::new( - DerivationPreset::IdentityMfa, - identity_addresses.len(), - ), - Self::new( - DerivationPreset::IdentityRola, - identity_addresses.len(), - ), - ]), - (false, false) => IdentifiedVecOf::from_iter([ - Self::new( - DerivationPreset::AccountMfa, - account_addresses.len(), - ), - Self::new( - DerivationPreset::AccountRola, - account_addresses.len(), - ), - Self::new( + (true, false) => { + let mut presets = IdentifiedVecOf::just(Self::new( DerivationPreset::IdentityMfa, identity_addresses.len(), - ), - Self::new( - DerivationPreset::IdentityRola, - identity_addresses.len(), - ), - ]), - (false, true) => IdentifiedVecOf::from_iter([ - Self::new( + )); + if include_rola_key_for_each_entity { + presets.append(Self::new( + DerivationPreset::IdentityRola, + identity_addresses.len(), + )); + } + presets + } + (false, false) => { + let mut presets = IdentifiedVecOf::from_iter([ + Self::new( + DerivationPreset::AccountMfa, + account_addresses.len(), + ), + Self::new( + DerivationPreset::IdentityMfa, + identity_addresses.len(), + ), + ]); + if include_rola_key_for_each_entity { + presets.append(Self::new( + DerivationPreset::AccountRola, + account_addresses.len(), + )); + presets.append(Self::new( + DerivationPreset::IdentityRola, + identity_addresses.len(), + )); + } + presets + } + (false, true) => { + let mut presets = IdentifiedVecOf::just(Self::new( DerivationPreset::AccountMfa, account_addresses.len(), - ), - Self::new( - DerivationPreset::AccountRola, - account_addresses.len(), - ), - ]), + )); + if include_rola_key_for_each_entity { + presets.append(Self::new( + DerivationPreset::AccountRola, + account_addresses.len(), + )); + } + presets + } } } } diff --git a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs b/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs index c8c5d8c57..045bc737a 100644 --- a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs +++ b/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs @@ -1801,7 +1801,6 @@ async fn create_single_account() { matrix_0, bdfs.clone(), ); - println!("šŸ‘Øā€šŸ”¬ test calling `make_security_structure_of_factor_instances_for_entities_without_consuming_cache_with_derivation_outcome` for single account Alice"); let (security_structures_of_fis, instances_in_cache_consumer, derivation_outcome) = os .make_security_structure_of_factor_instances_for_entities_without_consuming_cache_with_derivation_outcome( IndexSet::just(AddressOfAccountOrPersona::from(alice.address())), @@ -1809,7 +1808,6 @@ async fn create_single_account() { ) .await .unwrap(); - println!("šŸ‘Øā€šŸ”¬ āœ… `make_security_structure_of_factor_instances_for_entities_without_consuming_cache_with_derivation_outcome` for single account Alice āœ…"); // Don't forget to consume! instances_in_cache_consumer.consume().await.unwrap(); diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome.rs b/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome.rs index 80da4806a..5bcac12a2 100644 --- a/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome.rs +++ b/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome.rs @@ -1,7 +1,7 @@ use crate::prelude::*; -/// Identical to `InternalFactorInstancesProviderOutcome` but `FactorInstancesProviderOutcomeForFactor` instead of `InternalFactorInstancesProviderOutcomeForFactor`, having -/// renamed field values to make it clear that `to_cache` instances already have been cached. +/// A collection of `FactorInstancesProviderOutcomePerFactor` keyed under +/// DerivationPreset. #[derive(Clone, Debug)] pub struct FactorInstancesProviderOutcome { pub per_derivation_preset: @@ -26,6 +26,8 @@ impl FactorInstancesProviderOutcome { } } +/// A collection of `FactorInstancesProviderOutcomeForFactor` keyed by their +/// FactorSourceID #[derive(Clone, Debug)] pub struct FactorInstancesProviderOutcomePerFactor { pub per_factor: IndexMap< diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome.rs b/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome.rs index ad03566ab..be99d08f7 100644 --- a/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome.rs +++ b/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome.rs @@ -28,15 +28,6 @@ impl InternalFactorInstancesProviderOutcome { ) -> Option<&InternalFactorInstancesProviderOutcomePerFactor> { self.per_derivation_preset.get(&preset) } - - pub fn get_for_derivation_preset_for_factor( - &self, - preset: DerivationPreset, - factor_source_id: FactorSourceIDFromHash, - ) -> Option<&InternalFactorInstancesProviderOutcomeForFactor> { - self.get_for_derivation_preset(preset) - .and_then(|x| x.per_factor.get(&factor_source_id)) - } } #[derive(Clone, Debug)] @@ -59,7 +50,8 @@ impl InternalFactorInstancesProviderOutcome { } } - /// "Transposes" + /// For each value of each collection, "transposes" it. For more info see + /// `InternalFactorInstancesProviderOutcomePerFactor::transpose` pub fn transpose( pdp_pf_to_cache: InstancesPerDerivationPresetPerFactorSource, pdp_pf_to_use_directly: InstancesPerDerivationPresetPerFactorSource, diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs b/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs index 1ab52809a..0c98e3fe7 100644 --- a/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs +++ b/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs @@ -118,16 +118,30 @@ impl HasSampleValues for InternalFactorInstancesProviderOutcomeForFactor { } fn sample_other() -> Self { - Self::new(FactorSourceIDFromHash::sample_at(1), FactorInstances::new(IndexSet::from_iter([ - HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(2), - ])), FactorInstances::new(IndexSet::from_iter([ - HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(0), - ])), FactorInstances::new(IndexSet::from_iter([ - HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(0), - ])), FactorInstances::new(IndexSet::from_iter([ - HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(1), - HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(2), - ]))) + Self::new( + FactorSourceIDFromHash::sample_at(1), + FactorInstances::new( + IndexSet::from_iter([ + HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(2), + ]) + ), + FactorInstances::new( + IndexSet::from_iter([ + HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(0), + ]) + ), + FactorInstances::new( + IndexSet::from_iter([ + HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(0), + ]) + ), + FactorInstances::new( + IndexSet::from_iter([ + HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(1), + HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_1_securified_at_index(2), + ]) + ) + ) } } diff --git a/crates/sargon/src/factor_instances_provider/provider/provider_adopters/securify_entity_factor_instances_provider.rs b/crates/sargon/src/factor_instances_provider/provider/provider_adopters/securify_entity_factor_instances_provider.rs index 1cb550a40..513b7b750 100644 --- a/crates/sargon/src/factor_instances_provider/provider/provider_adopters/securify_entity_factor_instances_provider.rs +++ b/crates/sargon/src/factor_instances_provider/provider/provider_adopters/securify_entity_factor_instances_provider.rs @@ -23,7 +23,7 @@ impl SecurifyEntityFactorInstancesProvider { interactor: Arc, ) -> Result<(InstancesInCacheConsumer, FactorInstancesProviderOutcome)> { - Self::for_entity_mfa( + Self::securifying_unsecurified( cache_client, profile, security_structure_of_factor_sources, @@ -52,7 +52,7 @@ impl SecurifyEntityFactorInstancesProvider { interactor: Arc, ) -> Result<(InstancesInCacheConsumer, FactorInstancesProviderOutcome)> { - Self::for_entity_mfa( + Self::securifying_unsecurified( cache_client, profile, security_structure_of_factor_sources, @@ -73,7 +73,11 @@ impl SecurifyEntityFactorInstancesProvider { /// /// We are always reading from the beginning of each FactorInstance collection in the cache, /// and we are always appending to the end. - pub async fn for_entity_mfa( + pub async fn securifying_unsecurified( + // if you need to UPDATE already securified, upgrade this to conditionally consume ROLA + // factors, by not using `QuantifiedDerivationPreset::securifying_unsecurified_entities` + // below. I.e. create the set of `QuantifiedDerivationPreset` which does not unconditionally + // specify ROLA factors. cache_client: Arc, profile: Arc, security_structure_of_factor_sources: SecurityStructureOfFactorSources, @@ -132,48 +136,15 @@ impl SecurifyEntityFactorInstancesProvider { ); let quantified_derivation_presets = - QuantifiedDerivationPreset::mfa_for_entities( + QuantifiedDerivationPreset::securifying_unsecurified_entities( &addresses_of_entities, ); - println!( - "šŸŒ® FIP (Sec) quantified_derivation_presets: {:?}", - quantified_derivation_presets - ); - assert!(quantified_derivation_presets.len() >= 2); // at least one entity kind, and ROLA + TX: at least 2 let (instances_in_cache_consumer, outcome) = provider .provide_for_presets(quantified_derivation_presets, purpose) .await?; - if let Some(rola_accounts_outcome) = outcome - .get_for_derivation_preset_for_factor( - DerivationPreset::AccountRola, - security_structure_of_factor_sources - .authentication_signing_factor - .id_from_hash(), - ) - { - println!( - "šŸŒ® FIP (Sec) rola_accounts_outcome: {:#?}", - rola_accounts_outcome - ); - } - - if let Some(rola_personas_outcome) = outcome - .get_for_derivation_preset_for_factor( - DerivationPreset::IdentityRola, - security_structure_of_factor_sources - .authentication_signing_factor - .id_from_hash(), - ) - { - println!( - "šŸŒ® FIP (Sec) rola_personas_outcome: {:#?}", - rola_personas_outcome - ); - } - Ok((instances_in_cache_consumer, outcome.into())) } } @@ -351,18 +322,19 @@ mod tests { let profile = Arc::new(os.profile().unwrap()); let derivation_interactors = os.keys_derivation_interactor(); - let (instances_in_cache_consumer, outcome) = SUT::for_entity_mfa( - cache_client.clone(), - profile, - shield_0.clone(), - IndexSet::from_iter([ - AddressOfAccountOrPersona::from(alice.address()), - AddressOfAccountOrPersona::from(batman.address()), - ]), - derivation_interactors.clone(), - ) - .await - .unwrap(); + let (instances_in_cache_consumer, outcome) = + SUT::securifying_unsecurified( + cache_client.clone(), + profile, + shield_0.clone(), + IndexSet::from_iter([ + AddressOfAccountOrPersona::from(alice.address()), + AddressOfAccountOrPersona::from(batman.address()), + ]), + derivation_interactors.clone(), + ) + .await + .unwrap(); assert_eq!(outcome.per_derivation_preset.len(), 4); diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs index 5054da3af..9ac9a091d 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs @@ -221,31 +221,11 @@ impl SecurityStructureOfFactorInstances { >, security_structure_of_factor_sources: &SecurityStructureOfFactorSources, ) -> Result { - for (k, v) in consuming_instances.iter() { - println!("\n\n šŸ‘Øā€šŸ”¬ SSFI: fulfilling_structure_of_factor_sources_with_instances` consuming_instances BEFORE fulfilling matrix:"); - println!( - "šŸ‘Øā€šŸ”¬ SSFI - BEFORE - key: {:?}, instances: #{:?}", - k, - v.len() - ); - println!("\n\n šŸ›”ļø šŸ›”ļø šŸ›”ļø šŸ›”ļø šŸ›”ļø\n") - } - let matrix_of_factors = MatrixOfFactorInstances::fulfilling_matrix_of_factor_sources_with_instances( consuming_instances, security_structure_of_factor_sources.matrix_of_factors.clone(), )?; - for (k, v) in consuming_instances.iter() { - println!("\n\n šŸ‘Øā€šŸ”¬ SSFI: fulfilling_structure_of_factor_sources_with_instances` consuming_instances AFTER fulfilling matrix:"); - println!( - "šŸ‘Øā€šŸ”¬ SSFI - AFTER - key: {:?}, instances: #{:?}", - k, - v.len() - ); - println!("\n\n šŸ›”ļø šŸ›”ļø šŸ›”ļø šŸ›”ļø šŸ›”ļø\n") - } - let authentication_signing = if let Some(existing) = consuming_instances .get_mut( &security_structure_of_factor_sources @@ -253,8 +233,9 @@ impl SecurityStructureOfFactorInstances { .id_from_hash(), ) { let instance = existing.first_authentication_signing().ok_or( - CommonError::MissingRolaKeyForSecurityStructureOfFactorInstances, - ).inspect_err(|_| println!("šŸ‘Øā€šŸ”¬ SSFI āŒ first_authentication_signing failed => MissingRolaKeyForSecurityStructureOfFactorInstances āŒ"))?; + CommonError::MissingRolaKeyForSecurityStructureOfFactorInstances, + )?; + let _ = existing.shift_remove(&instance); // don't forget to consume it! Ok(instance) } else { diff --git a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs index 502c497c2..56babcb5b 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs @@ -812,10 +812,12 @@ impl SargonOS { let profile_snapshot = self.profile()?; let key_derivation_interactors = self.keys_derivation_interactor(); - println!("šŸ‘Øā€šŸ”¬ SargonOS => SecurifyEntityFactorInstancesProvider::for_entity_mfa"); - + // if you need to UPDATE already securified, upgrade this to conditionally consume ROLA + // factors, by not using `QuantifiedDerivationPreset::securifying_unsecurified_entities` + // inside of SecurifyEntityFactorInstancesProvider::securifying_unsecurified. I.e. create the set of `QuantifiedDerivationPreset` which does not unconditionally + // specify ROLA factors. let (instances_in_cache_consumer, outcome) = - SecurifyEntityFactorInstancesProvider::for_entity_mfa( + SecurifyEntityFactorInstancesProvider::securifying_unsecurified( Arc::new(self.clients.factor_instances_cache.clone()), Arc::new(profile_snapshot.clone()), security_structure_of_factor_sources.clone(), @@ -824,8 +826,6 @@ impl SargonOS { ) .await?; - println!("šŸ‘Øā€šŸ”¬ SargonOS => SecurifyEntityFactorInstancesProvider::for_entity_mfa āœ… outcome:\nšŸ”®šŸ”®šŸ”®\n\n{:?}\nšŸ”®šŸ”®šŸ”®šŸ”®šŸ”®šŸ”®šŸ”®šŸ”®\n", outcome); - let mut instances_per_preset_per_factor_source = outcome .clone() .per_derivation_preset @@ -874,50 +874,35 @@ impl SargonOS { return Ok(()); }; - let tx_preset = DerivationPreset::mfa_entity_kind(entity_kind); - let rola_preset = - DerivationPreset::rola_entity_kind(entity_kind); - - let instances_per_factor_source_mfa = instances_per_preset_per_factor_source - .swap_remove(&tx_preset) - .unwrap_or_else(|| panic!("Expected to find instances for derivation preset: {:?}", tx_preset)); - - for (k, v) in instances_per_factor_source_mfa.iter() { - println!( - "šŸ‘Øā€šŸ”¬ SargonOS šŸ¦§ mfa - #instances: {:?} for key: {:?}", - v.len(), - k - ); - } - - let instances_per_factor_source_rola = instances_per_preset_per_factor_source - .swap_remove(&rola_preset) - .unwrap_or_else(|| panic!("Expected to find instances for derivation preset: {:?}", rola_preset)); - - for (k, v) in instances_per_factor_source_rola.iter() { - println!("šŸ‘Øā€šŸ”¬ SargonOS šŸ¦§ ROLA - #instances: {:?} for key: {:?}", v.len(), k); - } - - let mut instances_per_factor_source = - instances_per_factor_source_mfa; - for (k, v) in instances_per_factor_source_rola { - instances_per_factor_source.append_or_insert_to(k, v); - } - - for (k, v) in instances_per_factor_source.iter() { - println!("šŸ‘Øā€šŸ”¬ SargonOS šŸ¦§ MERGED šŸ¦§ - #instances: {:?} for key: {:?}", v.len(), k); - } - - println!("šŸ‘Øā€šŸ”¬ SargonOS instances_per_factor_source: \n\n{:?}\n\nšŸŒˆšŸŒˆšŸŒˆšŸŒˆ\n", instances_per_factor_source); + let mut instances_per_factor_source = { + let tx_preset = + DerivationPreset::mfa_entity_kind(entity_kind); + let rola_preset = + DerivationPreset::rola_entity_kind(entity_kind); + + let instances_per_factor_source_mfa = instances_per_preset_per_factor_source + .swap_remove(&tx_preset) + .unwrap_or_else(|| panic!("Expected to find instances for derivation preset: {:?}", tx_preset)); + + let instances_per_factor_source_rola = instances_per_preset_per_factor_source + .swap_remove(&rola_preset) + .unwrap_or_else(|| panic!("Expected to find instances for derivation preset: {:?}", rola_preset)); + + // Merge `instances_per_factor_source_mfa` and `instances_per_factor_source_rola` together + let mut instances_per_factor_source = + instances_per_factor_source_mfa; + for (k, v) in instances_per_factor_source_rola { + instances_per_factor_source.append_or_insert_to(k, v); + } + instances_per_factor_source + }; for entity_address in addresses_of_kind.clone().into_iter() { - println!("šŸ‘Øā€šŸ”¬ SargonOS calling `SecurityStructureOfFactorInstances::fulfilling_structure_of_factor_sources_with_instances` for entity: {:?}", entity_address); let security_structure_of_factor_instances = SecurityStructureOfFactorInstances::fulfilling_structure_of_factor_sources_with_instances( &mut instances_per_factor_source, &security_structure_of_factor_sources )?; - println!("šŸ‘Øā€šŸ”¬ SargonOS `SecurityStructureOfFactorInstances::fulfilling_structure_of_factor_sources_with_instances` for entity āœ… : {:?}", entity_address); security_structures_of_factor_instances.insert( *entity_address, security_structure_of_factor_instances, diff --git a/crates/sargon/src/types/samples/account_samples.rs b/crates/sargon/src/types/samples/account_samples.rs index 1ce6e8c73..31c69e05f 100644 --- a/crates/sargon/src/types/samples/account_samples.rs +++ b/crates/sargon/src/types/samples/account_samples.rs @@ -17,7 +17,7 @@ static ALL_ACCOUNT_SAMPLES: Lazy<[Account; 10]> = Lazy::new(|| { // Carla | 2 | Securified { Single Threshold only } Account::sample_securified_mainnet( "Carla", -2, + 2, HierarchicalDeterministicFactorInstance::sample_mainnet_account_device_factor_fs_10_unsecurified_at_index(2), || { let idx = diff --git a/crates/sargon/src/types/samples/persona_samples.rs b/crates/sargon/src/types/samples/persona_samples.rs index 7a60fa617..9ddcbb2be 100644 --- a/crates/sargon/src/types/samples/persona_samples.rs +++ b/crates/sargon/src/types/samples/persona_samples.rs @@ -71,7 +71,7 @@ static ALL_PERSONA_SAMPLES: Lazy<[Persona; 8]> = Lazy::new(|| { // Kasparov | 6 | Securified { Threshold #3 and Override factors #2 } Persona::sample_securified_mainnet( "Kasparov", - 6, + 6, HierarchicalDeterministicFactorInstance::sample_mainnet_identity_device_factor_fs_10_unsecurified_at_index(6), || { let idx =