diff --git a/src/factor_instances_provider/factor_instances_provider.rs b/src/factor_instances_provider/factor_instances_provider.rs index cb2fb83b..362c4766 100644 --- a/src/factor_instances_provider/factor_instances_provider.rs +++ b/src/factor_instances_provider/factor_instances_provider.rs @@ -166,39 +166,6 @@ impl FactorInstancesProvider { requests_with_ranges_with_abundance.extend(requests_to_satisfy_with_ranges); requests_with_ranges_with_abundance.extend(fill_cache); - // for x in fill_cache.into_iter() { - // if let Some(request_with_range_without_abundance) = - // requests_to_satisfy_with_ranges.iter().find(|y| { - // let h = UnquantifiedUnindexDerivationRequest::from((*y).clone()); - // UnquantifiedUnindexDerivationRequest::from(x.clone()) == h - // }) - // { - // let request_with_range_with_abundance: DerivationRequestWithRange = { - // let quantity = 1 - 2; - // let start_base_index = 5 - 7; - // DerivationRequestWithRange::new( - // request_with_range_without_abundance.factor_source_id, - // request_with_range_without_abundance.network_id, - // request_with_range_without_abundance.entity_kind, - // request_with_range_without_abundance.key_kind, - // request_with_range_without_abundance.key_space, - // quantity, - // start_base_index, - // ) - // }; - - // requests_with_ranges_with_abundance - // .insert(request_with_range_with_abundance.clone()); - - // requests_to_satisfy_with_ranges.swap_remove(request_with_range_without_abundance); - // } else { - // let next = next_index_assigner.next(x.clone().into()); - // let request_with_range_with_abundance = - // DerivationRequestWithRange::from((x.clone(), next)); - // requests_with_ranges_with_abundance.insert(request_with_range_with_abundance); - // } - // } - requests_with_ranges_with_abundance .into_iter() .into_group_map_by(|x| x.factor_source_id) @@ -226,8 +193,6 @@ impl FactorInstancesProvider { purpose.clone(), ); - println!("🚀 deriving more, derivation_paths: {:?}", derivation_paths); - let keys_collector = KeysCollector::new( purpose.factor_sources(), derivation_paths, @@ -259,16 +224,9 @@ impl FactorInstancesProvider { let to_cache = to_cache.into_iter().cloned().collect::(); - println!( - "🍬⭐️ purpose: {:?}, using directly: {:?}, caching: {:?}", - purpose.clone(), - to_use_directly, - to_cache - ); NewlyDerived::maybe_some_to_use_directly(k, to_cache, to_use_directly) } else { let to_cache = v.into_iter().collect::(); - println!("🍬🤷‍♀️ Caching #{} instances", to_cache.len()); NewlyDerived::cache_all(k, to_cache) } }) @@ -413,7 +371,6 @@ mod tests { } pub fn clear_cache(&self) { - println!("💣 clearing cache!!!"); *self.cache.try_write().unwrap() = PreDerivedKeysCache::default(); } @@ -439,11 +396,6 @@ mod tests { network: NetworkID, name: impl AsRef, ) -> Result<(Account, DidDeriveNewFactorInstances)> { - println!( - "🔮 ADDING ACCOUNT: '{}', number of accounts in profile: #{}", - name.as_ref(), - self.profile_snapshot().accounts.len() - ); let interactors: Arc = Arc::new(TestDerivationInteractors::default()); @@ -676,14 +628,6 @@ mod tests { let free_factor_instances_after_account_creation = os.cache_snapshot().all_factor_instances(); - println!( - "🐳 DEBUG printing cache: #{}", - os.cache_snapshot().all_factor_instances().len() - ); - println!( - "🐳🐳🐳 DEBUG printing cache: {:?}", - os.cache_snapshot().all_factor_instances() - ); assert_eq!( free_factor_instances_after_account_creation.len(), (DerivationRequestQuantitySelector::FILL_CACHE_QUANTITY * 6 ) - 1, diff --git a/src/factor_instances_provider/next_derivation_index_analyzer.rs b/src/factor_instances_provider/next_derivation_index_analyzer.rs index d04906be..df6f1390 100644 --- a/src/factor_instances_provider/next_derivation_index_analyzer.rs +++ b/src/factor_instances_provider/next_derivation_index_analyzer.rs @@ -76,33 +76,12 @@ impl NextDerivationIndexFromProfile { .profile_snapshot .get_unsecurified_entities_of_kind_on_network(entity_kind, network_id); - println!( - "🎭🎭🎭 NextDerivationIndexFromProfile, all_unsecurified_in_profile: #{}", - all_unsecurified_in_profile.len() - ); - - let apor = all_unsecurified_in_profile + all_unsecurified_in_profile .into_iter() .map(|x: UnsecurifiedEntity| x.veci().factor_instance()) .filter(|fi| fi.matches(&unindexed_request)) - .collect::>(); - - println!( - "🎭🎭🎭 NextDerivationIndexFromProfile, apor: #{}", - apor.len() - ); - - let bananer = apor - .into_iter() .map(|fi| fi.derivation_path().index) - .collect::>(); - - println!( - "🎭🎭🎭 NextDerivationIndexFromProfile, bananer: {:?}", - bananer - ); - - bananer.into_iter().max() + .max() } }; @@ -151,20 +130,10 @@ impl NextIndexAssignerWithEphemeralLocalOffsets { .and_then(|p| p.read_next(unindexed_request.clone())) .unwrap_or(default); - println!( - "🎭 NextIndexAssignerWithEphemeralLocalOffs, from_profile: {}", - from_profile.base_index() - ); - let from_local = self.ephemeral_local_offsets.write_next(unindexed_request); let next = from_profile.add_n(from_local as HDPathValue); - println!( - "🎭 NextIndexAssignerWithEphemeralLocalOffs, next: {:?}", - next - ); - next } } diff --git a/src/recovery_securify_cache/helpers/unindex_derivation_request.rs b/src/recovery_securify_cache/helpers/unindex_derivation_request.rs index 4ace03c9..dc3321bc 100644 --- a/src/recovery_securify_cache/helpers/unindex_derivation_request.rs +++ b/src/recovery_securify_cache/helpers/unindex_derivation_request.rs @@ -147,7 +147,7 @@ pub enum DerivationRequestQuantitySelector { Poly { count: usize }, } impl DerivationRequestQuantitySelector { - pub const FILL_CACHE_QUANTITY: usize = 3; + pub const FILL_CACHE_QUANTITY: usize = 30; pub fn fill_cache_if_needed() -> Self { DerivationRequestQuantitySelector::Poly { count: Self::FILL_CACHE_QUANTITY,