Skip to content

Commit

Permalink
Bugfix/randomize cli db path (MystenLabs#367)
Browse files Browse the repository at this point in the history
* use randomized db for cfg file based cli
  • Loading branch information
oxade authored Feb 4, 2022
1 parent 3f73053 commit 4992273
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fastpay/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ use fastx_types::object::Object;
use futures::stream::StreamExt;
use std::{
collections::{BTreeMap, HashSet},
env,
path::PathBuf,
time::{Duration, Instant},
};
use structopt::StructOpt;
use tempfile::tempdir;
use tokio::runtime::Runtime;
use tracing::{subscriber::set_global_default, *};
use tracing_subscriber::EnvFilter;
Expand Down Expand Up @@ -478,7 +478,7 @@ fn main() {
let buffer_size = options.buffer_size;
let client_db_path = options
.db_path
.map_or(env::temp_dir().join("CLIENT_DB_0"), PathBuf::from);
.map_or(tempdir().unwrap().into_path(), PathBuf::from);

let mut accounts_config =
AccountsConfig::read_or_create(accounts_config_path).expect("Unable to read user accounts");
Expand Down Expand Up @@ -686,7 +686,7 @@ fn main() {
accounts_config.update_from_state(&client_state);
info!("Updating recipient's local balance");

let client2_db_path = env::temp_dir().join("CLIENT_DB_1");
let client2_db_path = tempdir().unwrap().into_path();
// TODO: client should manage multiple addresses instead of each addr having DBs
// https://github.com/MystenLabs/fastnft/issues/332
let mut recipient_client_state = make_client_state_and_try_sync(
Expand Down

0 comments on commit 4992273

Please sign in to comment.