From 3005605235d67e69b9dcf28fdf2431d7d553451b Mon Sep 17 00:00:00 2001 From: Maria Kuklina Date: Wed, 21 Feb 2024 12:41:47 +0100 Subject: [PATCH] fix data store test --- Cargo.lock | 1 + aquamarine/src/particle_data_store.rs | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 249eed8695..61c80c9c87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5665,6 +5665,7 @@ dependencies = [ "cid 0.11.0", "eyre", "fluence-app-service", + "fluence-libp2p", "fs-utils", "fstrings", "itertools 0.12.1", diff --git a/aquamarine/src/particle_data_store.rs b/aquamarine/src/particle_data_store.rs index 6a1f5915b8..a6ba6cbe95 100644 --- a/aquamarine/src/particle_data_store.rs +++ b/aquamarine/src/particle_data_store.rs @@ -317,6 +317,7 @@ mod tests { use crate::ParticleDataStore; use avm_server::avm_runner::RawAVMOutcome; use avm_server::{CallRequests, CallResults, CallServiceResult}; + use fluence_libp2p::PeerId; use std::path::PathBuf; use std::time::Duration; @@ -500,17 +501,21 @@ mod tests { .expect("Failed to initialize"); let particle_id = "test_particle"; - let current_peer_id = "test_peer"; + let current_peer_id = PeerId::random(); + let current_peer_id_str = current_peer_id.to_base58(); let signature: &[u8] = &[]; let data = b"test_data"; particle_data_store - .store_data(data, particle_id, current_peer_id, signature) + .store_data(data, particle_id, ¤t_peer_id_str, signature) .await .expect("Failed to store data"); - let data_file_path = particle_data_store.data_file(particle_id, current_peer_id, signature); - let vault_path = temp_dir_path.join("vault").join(particle_id); + let data_file_path = + particle_data_store.data_file(particle_id, ¤t_peer_id_str, signature); + let vault_path = particle_data_store + .vault + .real_particle_vault(current_peer_id, particle_id); tokio::fs::create_dir_all(&vault_path) .await .expect("Failed to create vault dir");