]> Untitled Git - bdk/commitdiff
Remove usage of blockdata:: from bitcoin paths
authorTobin C. Harding <me@tobin.cc>
Wed, 26 Jun 2024 04:33:00 +0000 (14:33 +1000)
committerTobin C. Harding <me@tobin.cc>
Thu, 27 Jun 2024 00:27:54 +0000 (10:27 +1000)
In `rust-bitcoin` the `blockdata` module is a code organisation thing,
it should never have been public. One day those guys would like to
remove it, so as not to be a PITA for `bdk` when they do lets remove all
usage of `blockdata::` now.

Internal change only, no externally visible changes.

crates/wallet/src/types.rs
crates/wallet/src/wallet/mod.rs
crates/wallet/tests/wallet.rs
nursery/tmp_plan/src/lib.rs

index 0370e55d6dd9c7de6cdbc981dc12cb9608847321..6ed17b5757675b09bf0ba82446966e7d4838654b 100644 (file)
@@ -13,7 +13,7 @@ use alloc::boxed::Box;
 use core::convert::AsRef;
 
 use bdk_chain::ConfirmationTime;
-use bitcoin::blockdata::transaction::{OutPoint, Sequence, TxOut};
+use bitcoin::transaction::{OutPoint, Sequence, TxOut};
 use bitcoin::{psbt, Weight};
 
 use serde::{Deserialize, Serialize};
index 71fb39f7d13e25a8c9c968c045a4965191876285..9fa9e5300738b24d5ab0ec636fc8e53dae8988fe 100644 (file)
@@ -2530,7 +2530,7 @@ fn create_signers<E: IntoWalletDescriptor>(
 #[doc(hidden)]
 macro_rules! floating_rate {
     ($rate:expr) => {{
-        use $crate::bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;
+        use $crate::bitcoin::constants::WITNESS_SCALE_FACTOR;
         // sat_kwu / 250.0 -> sat_vb
         $rate.to_sat_per_kwu() as f64 / ((1000 / WITNESS_SCALE_FACTOR) as f64)
     }};
index 5b8d3abd0671980d039210e16ffb2e52902d8405..1f8aa45100c037ff8aac4b2315c2e981f28f4fb8 100644 (file)
@@ -201,8 +201,7 @@ fn new_or_load() -> anyhow::Result<()> {
         // wrong genesis hash
         {
             let exp_blockhash = BlockHash::all_zeros();
-            let got_blockhash =
-                bitcoin::blockdata::constants::genesis_block(Network::Testnet).block_hash();
+            let got_blockhash = bitcoin::constants::genesis_block(Network::Testnet).block_hash();
 
             let db = &mut new_or_load(&file_path).expect("must open db");
             let changeset = read(db)?;
index d39a7fe6ce9f2325f6e62d6d28ebfc544c124e64..08c28d846a9d4c985d95800e50c83f97cbe3ab42 100644 (file)
@@ -18,11 +18,11 @@ use bdk_chain::{bitcoin, collections::*, miniscript};
 use bitcoin::{
     absolute,
     bip32::{DerivationPath, Fingerprint, KeySource},
-    blockdata::transaction::Sequence,
     ecdsa,
     hashes::{hash160, ripemd160, sha256},
     secp256k1::Secp256k1,
     taproot::{self, LeafVersion, TapLeafHash},
+    transaction::Sequence,
     ScriptBuf, TxIn, Witness, WitnessVersion,
 };
 use miniscript::{