Merge bitcoindevkit/bdk#1490: Remove usage of blockdata:: from bitcoin paths

cf7aca84d113e639441350651112e9e701364497 Remove usage of blockdata:: from bitcoin paths (Tobin C. Harding)

Pull request description:

  ### Description

  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.

  ### Changelog notice

  Internal change only, no externally visible changes.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

Top commit has no ACKs.

Tree-SHA512: 4c5e54a2ac3f71835c25ce97ad0acd1859e5ae8d45ebfde087e19e9494754e0aa70a47ca5f3d6a3b509f27e28ef9d4a5269573c686250f43834d09378155681c
This commit is contained in:
Steve Myers 2024-06-28 15:54:47 -05:00
commit d75d9f94ce
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051
4 changed files with 4 additions and 5 deletions

View File

@ -13,7 +13,7 @@ use alloc::boxed::Box;
use core::convert::AsRef; use core::convert::AsRef;
use bdk_chain::ConfirmationTime; use bdk_chain::ConfirmationTime;
use bitcoin::blockdata::transaction::{OutPoint, Sequence, TxOut}; use bitcoin::transaction::{OutPoint, Sequence, TxOut};
use bitcoin::{psbt, Weight}; use bitcoin::{psbt, Weight};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View File

@ -2530,7 +2530,7 @@ fn create_signers<E: IntoWalletDescriptor>(
#[doc(hidden)] #[doc(hidden)]
macro_rules! floating_rate { macro_rules! floating_rate {
($rate:expr) => {{ ($rate:expr) => {{
use $crate::bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR; use $crate::bitcoin::constants::WITNESS_SCALE_FACTOR;
// sat_kwu / 250.0 -> sat_vb // sat_kwu / 250.0 -> sat_vb
$rate.to_sat_per_kwu() as f64 / ((1000 / WITNESS_SCALE_FACTOR) as f64) $rate.to_sat_per_kwu() as f64 / ((1000 / WITNESS_SCALE_FACTOR) as f64)
}}; }};

View File

@ -201,8 +201,7 @@ fn new_or_load() -> anyhow::Result<()> {
// wrong genesis hash // wrong genesis hash
{ {
let exp_blockhash = BlockHash::all_zeros(); let exp_blockhash = BlockHash::all_zeros();
let got_blockhash = let got_blockhash = bitcoin::constants::genesis_block(Network::Testnet).block_hash();
bitcoin::blockdata::constants::genesis_block(Network::Testnet).block_hash();
let db = &mut new_or_load(&file_path).expect("must open db"); let db = &mut new_or_load(&file_path).expect("must open db");
let changeset = read(db)?; let changeset = read(db)?;

View File

@ -18,11 +18,11 @@ use bdk_chain::{bitcoin, collections::*, miniscript};
use bitcoin::{ use bitcoin::{
absolute, absolute,
bip32::{DerivationPath, Fingerprint, KeySource}, bip32::{DerivationPath, Fingerprint, KeySource},
blockdata::transaction::Sequence,
ecdsa, ecdsa,
hashes::{hash160, ripemd160, sha256}, hashes::{hash160, ripemd160, sha256},
secp256k1::Secp256k1, secp256k1::Secp256k1,
taproot::{self, LeafVersion, TapLeafHash}, taproot::{self, LeafVersion, TapLeafHash},
transaction::Sequence,
ScriptBuf, TxIn, Witness, WitnessVersion, ScriptBuf, TxIn, Witness, WitnessVersion,
}; };
use miniscript::{ use miniscript::{