Skip to content

Commit

Permalink
fix data store test
Browse files Browse the repository at this point in the history
  • Loading branch information
kmd-fl committed Feb 21, 2024
1 parent 1b9f0db commit 3005605
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions aquamarine/src/particle_data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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, &current_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, &current_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");
Expand Down

0 comments on commit 3005605

Please sign in to comment.