Skip to content

Commit

Permalink
minor: Add some debug! statements to regtest
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxFangX committed Oct 7, 2022
1 parent f9ed446 commit a8dd921
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/src/test_utils/regtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use bitcoin::network::constants::Network;
use bitcoin::util::address::{Address, Payload};
use bitcoind::bitcoincore_rpc::RpcApi;
use bitcoind::{self, BitcoinD, Conf};
use tracing::debug;

use crate::cli::BitcoindRpcInfo;

Expand Down Expand Up @@ -50,6 +51,7 @@ impl Regtest {

/// Mines 6 blocks. Block rewards are sent to a dummy address.
pub async fn mine_6_blocks(&self) {
debug!("Mining 6 blocks");
// `bitcoind.client.generate()` returns a deprecated error, so we use
// generate_to_address instead.
self.mine_n_blocks_to_address(6, &get_dummy_address()).await;
Expand All @@ -58,6 +60,7 @@ impl Regtest {
/// Mines 101 blocks to the given address. 101 blocks is needed because
/// coinbase outputs aren't spendable until after 100 blocks.
pub async fn fund_address(&self, address: &Address) {
debug!("Funding address {address} by mining 101 blocks");
self.mine_n_blocks_to_address(101, address).await;
}

Expand Down

0 comments on commit a8dd921

Please sign in to comment.