Skip to content

Commit 47b3f33

Browse files
committed
Make sure bitcoind has unique dirs
1 parent e6a8445 commit 47b3f33

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎orange-sdk/tests/test_utils.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ pub async fn wait_next_event(wallet: &orange_sdk::Wallet) -> orange_sdk::Event {
6060
event
6161
}
6262

63-
fn create_bitcoind() -> Bitcoind {
63+
fn create_bitcoind(uuid: Uuid) -> Bitcoind {
6464
let mut conf = Conf::default();
6565
conf.args.push("-txindex");
6666
conf.args.push("-rpcworkqueue=100");
67+
conf.staticdir = Some(temp_dir().join(format!("orange-test-{uuid}/bitcoind")));
6768
let bitcoind = Bitcoind::with_conf(corepc_node::downloaded_exe_path().unwrap(), &conf).unwrap();
6869

6970
// Wait for bitcoind to be ready before returning
@@ -226,12 +227,11 @@ pub struct TestParams {
226227
}
227228

228229
pub fn build_test_nodes() -> TestParams {
229-
let bitcoind = Arc::new(create_bitcoind());
230+
let test_id = Uuid::now_v7();
231+
let bitcoind = Arc::new(create_bitcoind(test_id));
230232

231233
let rt = Arc::new(tokio::runtime::Builder::new_multi_thread().enable_all().build().unwrap());
232234

233-
let test_id = Uuid::now_v7();
234-
235235
let lsp = create_lsp(Arc::clone(&rt), test_id, &bitcoind);
236236
fund_node(&lsp, &bitcoind);
237237
let third_party = create_third_party(Arc::clone(&rt), test_id, &bitcoind);

0 commit comments

Comments
 (0)