Skip to content

Commit

Permalink
Fix preview test (#2795)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Dec 1, 2023
1 parent 6f64528 commit b6553c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/subcommand/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,19 @@ impl Preview {

fs::create_dir(&bitcoin_data_dir)?;

eprintln!("Spawning bitcoind…");

let _bitcoind = KillOnDrop(
Command::new("bitcoind")
.arg({
let mut arg = OsString::from("-datadir=");
arg.push(&bitcoin_data_dir);
arg
})
.arg("-listen=0")
.arg("-printtoconsole=0")
.arg("-regtest")
.arg("-txindex")
.arg("-listen=0")
.arg(format!("-rpcport={rpc_port}"))
.spawn()
.context("failed to spawn `bitcoind`")?,
Expand Down Expand Up @@ -89,6 +92,8 @@ impl Preview {
.get_new_address(None, Some(bitcoincore_rpc::json::AddressType::Bech32m))?
.require_network(Network::Regtest)?;

eprintln!("Mining blocks…");

rpc_client.generate_to_address(101, &address)?;

if let Some(files) = self.files {
Expand Down

0 comments on commit b6553c1

Please sign in to comment.