Skip to content

Commit

Permalink
fix: testing with custom path
Browse files Browse the repository at this point in the history
  • Loading branch information
EdsonAlcala committed Sep 26, 2024
1 parent 4af1194 commit 6ef58af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
needs: []
strategy:
matrix:
platform: [ubuntu-latest]
platform: [ubuntu-latest, macos-latest]
toolchain: [stable]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ near-workspaces = { version = "0.13.0", features = [
near-jsonrpc-client = { git = "https://github.com/EdsonAlcala/near-jsonrpc-client-rs", tag = "v0.12.1" }

# bitcoin
tempfile = "3.3.0"
bitcoin = { version = "0.32.0", default-features = false, features = [
"std",
"serde",
Expand Down
8 changes: 7 additions & 1 deletion tests/bitcoin_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use omni_transaction::types::BITCOIN;
use eyre::Result;
use serde_json::json;
use std::result::Result::Ok;
use tempfile::TempDir;

mod utils;

Expand All @@ -38,7 +39,12 @@ fn setup_bitcoin_testnet() -> Result<bitcoind::BitcoinD> {
} else {
return Err(std::io::Error::new(std::io::ErrorKind::Other, "Unsupported platform").into());
};
let bitcoind = bitcoind::BitcoinD::new(bitcoind_path).unwrap();

let temp_dir = TempDir::new().expect("Failed to create temp dir");

let mut conf = bitcoind::Conf::default();
conf.tmpdir = Some(temp_dir.path().to_path_buf());
let bitcoind = bitcoind::BitcoinD::with_conf(bitcoind_path, &conf).unwrap();
Ok(bitcoind)
}

Expand Down

0 comments on commit 6ef58af

Please sign in to comment.