From 1df3c64337b10085d4eb423c46e80d14ed8a028b Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Thu, 3 Nov 2022 22:32:20 -0400 Subject: [PATCH] chore: fix typos and add test_debug! outputs --- .../src/burnchains/bitcoin_regtest_controller.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs b/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs index 2015a2115..d21b43972 100644 --- a/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs +++ b/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs @@ -641,6 +641,14 @@ impl BitcoinRegtestController { let address = BitcoinAddress::from_bytes(network_id, BitcoinAddressType::PublicKeyHash, &pkh) .expect("Public key incorrect"); + + test_debug!( + "Get UTXOs for {} ({}) rbf={}", + public_key.to_hex(), + address.to_b58(), + self.allow_rbf + ); + let filter_addresses = vec![address.to_b58()]; let mut utxos = loop { @@ -1089,7 +1097,7 @@ impl BitcoinRegtestController { } } - // Did a re-org occurred since we fetched our UTXOs, or are the UTXOs so stale that they should be abandoned? + // Did a re-org occur since we fetched our UTXOs, or are the UTXOs so stale that they should be abandoned? let mut traversal_depth = 0; let mut burn_chain_tip = burnchain_db.get_canonical_chain_tip().ok()?; let mut found_last_mined_at = false; @@ -1359,6 +1367,7 @@ impl BitcoinRegtestController { /// Send a serialized tx to the Bitcoin node. Return true on successful send; false on /// failure. pub fn send_transaction(&self, transaction: SerializedTx) -> bool { + test_debug!("Send tx {}", transaction.to_hex()); let result = BitcoinRPCRequest::send_raw_transaction(&self.config, transaction.to_hex()); match result { Ok(_) => true, @@ -1709,7 +1718,7 @@ impl SerializedTx { SerializedTx { bytes } } - fn to_hex(&self) -> String { + pub fn to_hex(&self) -> String { let formatted_bytes: Vec = self.bytes.iter().map(|b| format!("{:02x}", b)).collect(); format!("{}", formatted_bytes.join(""))