Skip to content

Commit

Permalink
ensure FactorInstancesCacheClient uses In-Memory cache for more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Jan 2, 2025
1 parent e461656 commit d81f018
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions crates/sargon/src/system/sargon_os/sargon_os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,9 @@ impl SargonOS {
let test_drivers =
Drivers::with_file_system(InMemoryFileSystemDriver::new());
let bios = Bios::new(test_drivers);
let clients = Clients::new(bios.clone());

let mut clients = Clients::new(bios.clone());
clients.factor_instances_cache =
FactorInstancesCacheClient::in_memory();
let keys_derivation_interactor =
derivation_interactor.into().unwrap_or_else(|| {
Arc::new(TestDerivationInteractor::new(
Expand Down
12 changes: 9 additions & 3 deletions crates/sargon/src/system/sargon_os/sargon_os_personas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,9 @@ mod tests {
// ARRANGE (and ACT)
let event_bus_driver = RustEventBusDriver::new();
let drivers = Drivers::with_event_bus(event_bus_driver.clone());
let clients = Clients::new(Bios::new(drivers));
let mut clients = Clients::new(Bios::new(drivers));
clients.factor_instances_cache =
FactorInstancesCacheClient::in_memory();
let interactors = Interactors::new_from_clients(&clients);

let os = timeout(
Expand Down Expand Up @@ -991,7 +993,9 @@ mod tests {
// ARRANGE (and ACT)
let event_bus_driver = RustEventBusDriver::new();
let drivers = Drivers::with_event_bus(event_bus_driver.clone());
let clients = Clients::new(Bios::new(drivers));
let mut clients = Clients::new(Bios::new(drivers));
clients.factor_instances_cache =
FactorInstancesCacheClient::in_memory();
let interactors = Interactors::new_from_clients(&clients);

let os = timeout(
Expand Down Expand Up @@ -1025,7 +1029,9 @@ mod tests {
// ARRANGE (and ACT)
let event_bus_driver = RustEventBusDriver::new();
let drivers = Drivers::with_event_bus(event_bus_driver.clone());
let clients = Clients::new(Bios::new(drivers));
let mut clients = Clients::new(Bios::new(drivers));
clients.factor_instances_cache =
FactorInstancesCacheClient::in_memory();
let interactors = Interactors::new_from_clients(&clients);

let os = timeout(
Expand Down

0 comments on commit d81f018

Please sign in to comment.