]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Do not use bitcoin::blockdata
authorTobin C. Harding <me@tobin.cc>
Wed, 7 Aug 2024 21:13:26 +0000 (07:13 +1000)
committerTobin C. Harding <me@tobin.cc>
Wed, 7 Aug 2024 21:13:26 +0000 (07:13 +1000)
The `rust-bitcoin` project is working towards making the public API
separate from the directory structure; eventually the
`bitcoin::blockdata` will go away, to make maintenance easier here stop
using the `blockdata` module.

Do not run the formatter, so as to make review easier. This patch was
created mechanically using:

search-and-replace bitcoin::blockdata bitcoin

and having defined

```bash
search-and-replace () {
        if (($# != 2))
        then
                echo "Usage: $0 <this> <that>"
                return
        fi
        local this="$1"
        local that="$2"
        for file in $(git grep -l "$this")
        do
                perl -pi -e "s/$this/$that/g" "$file"
        done
}
```

60 files changed:
fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs
fuzz/src/onion_message.rs
fuzz/src/router.rs
lightning-background-processor/src/lib.rs
lightning-block-sync/src/convert.rs
lightning-block-sync/src/gossip.rs
lightning-block-sync/src/init.rs
lightning-block-sync/src/lib.rs
lightning-block-sync/src/test_utils.rs
lightning-invoice/src/utils.rs
lightning-net-tokio/src/lib.rs
lightning-rapid-gossip-sync/src/lib.rs
lightning-rapid-gossip-sync/src/processing.rs
lightning-transaction-sync/tests/integration_tests.rs
lightning/src/chain/chaininterface.rs
lightning/src/chain/chainmonitor.rs
lightning/src/chain/channelmonitor.rs
lightning/src/chain/mod.rs
lightning/src/chain/onchaintx.rs
lightning/src/chain/package.rs
lightning/src/chain/transaction.rs
lightning/src/events/bump_transaction.rs
lightning/src/events/mod.rs
lightning/src/ln/async_signer_tests.rs
lightning/src/ln/chan_utils.rs
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/interactivetxs.rs
lightning/src/ln/monitor_tests.rs
lightning/src/ln/msgs.rs
lightning/src/ln/onion_route_tests.rs
lightning/src/ln/peer_handler.rs
lightning/src/ln/priv_short_conf_tests.rs
lightning/src/ln/reorg_tests.rs
lightning/src/ln/script.rs
lightning/src/ln/shutdown_tests.rs
lightning/src/offers/invoice.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/offer.rs
lightning/src/offers/refund.rs
lightning/src/offers/static_invoice.rs
lightning/src/routing/gossip.rs
lightning/src/routing/router.rs
lightning/src/routing/scoring.rs
lightning/src/routing/test_utils.rs
lightning/src/routing/utxo.rs
lightning/src/sign/ecdsa.rs
lightning/src/sign/mod.rs
lightning/src/sign/taproot.rs
lightning/src/util/macro_logger.rs
lightning/src/util/scid_utils.rs
lightning/src/util/ser.rs
lightning/src/util/sweep.rs
lightning/src/util/test_channel_signer.rs
lightning/src/util/test_utils.rs
lightning/src/util/transaction_utils.rs

index 2fb0277e1651f37fc04c9fbc27561e5ba385d3e6..48bd5590b9474c024bf4a52b77d5d5e832781620 100644 (file)
 //! channel being force-closed.
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::genesis_block;
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::opcodes;
-use bitcoin::blockdata::script::{Builder, ScriptBuf};
-use bitcoin::blockdata::transaction::{Transaction, TxOut};
+use bitcoin::constants::genesis_block;
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::opcodes;
+use bitcoin::script::{Builder, ScriptBuf};
+use bitcoin::transaction::{Transaction, TxOut};
 use bitcoin::network::Network;
 use bitcoin::transaction::Version;
 
index 9c45c66e1a4e895859b2048845a8694e063dc79d..7733e21c804c514088af68e1acd2c1736e9b63f8 100644 (file)
 //! This test has been very useful, though due to its complexity good starting inputs are critical.
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::genesis_block;
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::opcodes;
-use bitcoin::blockdata::script::{Builder, ScriptBuf};
-use bitcoin::blockdata::transaction::{Transaction, TxOut};
+use bitcoin::constants::genesis_block;
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::opcodes;
+use bitcoin::script::{Builder, ScriptBuf};
+use bitcoin::transaction::{Transaction, TxOut};
 use bitcoin::consensus::encode::deserialize;
 use bitcoin::network::Network;
 use bitcoin::transaction::Version;
index 490b7d72a176ece0b425c0235bf6166529763f32..0b9aceaf97b7210faca820ecb982bf8d8701a9a8 100644 (file)
@@ -1,6 +1,6 @@
 // Imports that need to be added manually
 use bech32::u5;
-use bitcoin::blockdata::script::ScriptBuf;
+use bitcoin::script::ScriptBuf;
 use bitcoin::secp256k1::ecdh::SharedSecret;
 use bitcoin::secp256k1::ecdsa::RecoverableSignature;
 use bitcoin::secp256k1::schnorr;
index a4002682111cd4cbd249bb29644fa9705fb8b085..034672fb275ddb37f5dbf9cebbcc1d60580df9b6 100644 (file)
@@ -8,9 +8,9 @@
 // licenses.
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::ChainHash;
-use bitcoin::blockdata::script::Builder;
-use bitcoin::blockdata::transaction::TxOut;
+use bitcoin::constants::ChainHash;
+use bitcoin::script::Builder;
+use bitcoin::transaction::TxOut;
 
 use lightning::blinded_path::{BlindedHop, BlindedPath, IntroductionNode};
 use lightning::chain::transaction::OutPoint;
index 314de7465089af363dd08abe267888380d5eb090..d49b8b89f370183a23c817ab3f15ef6c8021144b 100644 (file)
@@ -1011,9 +1011,9 @@ impl Drop for BackgroundProcessor {
 #[cfg(all(feature = "std", test))]
 mod tests {
        use super::{BackgroundProcessor, GossipSync, FRESHNESS_TIMER};
-       use bitcoin::blockdata::constants::{genesis_block, ChainHash};
-       use bitcoin::blockdata::locktime::absolute::LockTime;
-       use bitcoin::blockdata::transaction::{Transaction, TxOut};
+       use bitcoin::constants::{genesis_block, ChainHash};
+       use bitcoin::locktime::absolute::LockTime;
+       use bitcoin::transaction::{Transaction, TxOut};
        use bitcoin::hashes::Hash;
        use bitcoin::network::Network;
        use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
index 06e43d61dc0b99d54d41d1c0b184556d0cc2a020..7a1bc02ac19904d4d3814e0fec180631df67db3f 100644 (file)
@@ -2,7 +2,7 @@ use crate::http::{BinaryResponse, JsonResponse};
 use crate::utils::hex_to_work;
 use crate::{BlockHeaderData, BlockSourceError};
 
-use bitcoin::blockdata::block::{Block, Header};
+use bitcoin::block::{Block, Header};
 use bitcoin::consensus::encode;
 use bitcoin::hash_types::{BlockHash, TxMerkleNode, Txid};
 use bitcoin::hashes::hex::FromHex;
@@ -95,7 +95,7 @@ impl TryFrom<serde_json::Value> for BlockHeaderData {
 
                Ok(BlockHeaderData {
                        header: Header {
-                               version: bitcoin::blockdata::block::Version::from_consensus(
+                               version: bitcoin::block::Version::from_consensus(
                                        get_field!("version", as_i64).try_into().map_err(|_| ())?,
                                ),
                                prev_blockhash: if let Some(hash_str) = response.get("previousblockhash") {
@@ -292,7 +292,7 @@ impl TryInto<GetUtxosResponse> for JsonResponse {
 #[cfg(test)]
 pub(crate) mod tests {
        use super::*;
-       use bitcoin::blockdata::constants::genesis_block;
+       use bitcoin::constants::genesis_block;
        use bitcoin::hashes::Hash;
        use bitcoin::network::Network;
        use hex::DisplayHex;
index 657a413fd069472eaa1a7965d1ad2828b06dc113..72a77d4a9b8d0c39c7d0f7fd0b030109d3240a4f 100644 (file)
@@ -4,9 +4,9 @@
 
 use crate::{AsyncBlockSourceResult, BlockData, BlockSource, BlockSourceError};
 
-use bitcoin::blockdata::block::Block;
-use bitcoin::blockdata::constants::ChainHash;
-use bitcoin::blockdata::transaction::{OutPoint, TxOut};
+use bitcoin::block::Block;
+use bitcoin::constants::ChainHash;
+use bitcoin::transaction::{OutPoint, TxOut};
 use bitcoin::hash_types::BlockHash;
 
 use lightning::ln::peer_handler::APeerManager;
index 4e893e11cf67b6e24996da6afecad87840b3c27c..cd414f55d61a6a544bf97cfdafa37f7edbd7614d 100644 (file)
@@ -4,7 +4,7 @@
 use crate::poll::{ChainPoller, Validate, ValidatedBlockHeader};
 use crate::{BlockSource, BlockSourceResult, Cache, ChainNotifier};
 
-use bitcoin::blockdata::block::Header;
+use bitcoin::block::Header;
 use bitcoin::hash_types::BlockHash;
 use bitcoin::network::Network;
 
index 2e3178ffc1238d887b601e3c3544bf061b222ed3..66669f89c003b5d9f2c8cb39d4bb76584aa6b546 100644 (file)
@@ -44,7 +44,7 @@ mod utils;
 
 use crate::poll::{ChainTip, Poll, ValidatedBlockHeader};
 
-use bitcoin::blockdata::block::{Block, Header};
+use bitcoin::block::{Block, Header};
 use bitcoin::hash_types::BlockHash;
 use bitcoin::pow::Work;
 
index 506c2183e6b341812f4191a7a054edf5ee5e0c88..960c72ad3132e10fe0ee907a5a5e85de37f12ae7 100644 (file)
@@ -4,9 +4,9 @@ use crate::{
        UnboundedCache,
 };
 
-use bitcoin::blockdata::block::{Block, Header, Version};
-use bitcoin::blockdata::constants::genesis_block;
-use bitcoin::blockdata::locktime::absolute::LockTime;
+use bitcoin::block::{Block, Header, Version};
+use bitcoin::constants::genesis_block;
+use bitcoin::locktime::absolute::LockTime;
 use bitcoin::hash_types::{BlockHash, TxMerkleNode};
 use bitcoin::network::Network;
 use bitcoin::transaction;
index fa301a8dc0629de7aa69bbf313154de48a43a74f..669e6f50f1ac93f72e3707770a645f95f3755c18 100644 (file)
@@ -1329,7 +1329,7 @@ mod test {
                } else {
                        None
                };
-               let genesis_timestamp = bitcoin::blockdata::constants::genesis_block(bitcoin::Network::Testnet).header.time as u64;
+               let genesis_timestamp = bitcoin::constants::genesis_block(bitcoin::Network::Testnet).header.time as u64;
                let non_default_invoice_expiry_secs = 4200;
 
                let invoice =
index a537289c2c464f231e62704bfccbd2a487992890..a5f4de470dfbc1afac159cbf5a1b00ce098baba6 100644 (file)
@@ -620,7 +620,7 @@ impl Hash for SocketDescriptor {
 
 #[cfg(test)]
 mod tests {
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
        use bitcoin::Network;
        use lightning::events::*;
index c6951301cd774d701aa476f4612b5209e80b54ef..25a94e77692e33d895b3f5c2ae393ffe4cb23c44 100644 (file)
@@ -39,7 +39,7 @@
 //! from disk, which we do by calling [`RapidGossipSync::update_network_graph`]:
 //!
 //! ```
-//! use bitcoin::blockdata::constants::genesis_block;
+//! use bitcoin::constants::genesis_block;
 //! use bitcoin::Network;
 //! use lightning::routing::gossip::NetworkGraph;
 //! use lightning_rapid_gossip_sync::RapidGossipSync;
index 43d03c6d70e357f77e645eb18089bd9096b0ef4b..80163472e2839b7f2c584feac5c0ce05f9dfa46c 100644 (file)
@@ -2,7 +2,7 @@ use core::cmp::max;
 use core::ops::Deref;
 use core::sync::atomic::Ordering;
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::secp256k1::PublicKey;
 
 use lightning::io;
index b30594a717d9802cdabe766a2e9f3faa8bc3ae4c..56c0f6a018f39e3032918a34c013da3ff4de02e3 100644 (file)
@@ -12,8 +12,8 @@ use lightning_transaction_sync::ElectrumSyncClient;
 use lightning_transaction_sync::EsploraSyncClient;
 
 use bdk_macros::maybe_await;
-use bitcoin::blockdata::block::Header;
-use bitcoin::blockdata::constants::genesis_block;
+use bitcoin::block::Header;
+use bitcoin::constants::genesis_block;
 use bitcoin::network::Network;
 use bitcoin::{Amount, BlockHash, Txid};
 use bitcoind::bitcoincore_rpc::RpcApi;
index 9909e115ed610d63f10fdfab9ee8397ac1363641..ba9e9d1febfdff1a4d128dbabbbb1d84c4b0f337 100644 (file)
@@ -17,7 +17,7 @@ use core::{cmp, ops::Deref};
 
 use crate::prelude::*;
 
-use bitcoin::blockdata::transaction::Transaction;
+use bitcoin::transaction::Transaction;
 
 // TODO: Define typed abstraction over feerates to handle their conversions.
 pub(crate) fn compute_feerate_sat_per_1000_weight(fee_sat: u64, weight: u64) -> u32 {
index 57c673239f7afcc326b2dde0d131df730a184ccb..12e67978a584b1a0489913abd167e5a3f6ced823 100644 (file)
@@ -23,7 +23,7 @@
 //! events. The remote server would make use of [`ChainMonitor`] for block processing and for
 //! servicing [`ChannelMonitor`] updates from the client.
 
-use bitcoin::blockdata::block::Header;
+use bitcoin::block::Header;
 use bitcoin::hash_types::{Txid, BlockHash};
 
 use crate::chain;
index e097c97058c7e58fd3b677687dc519e400f2143a..1eb40da57e8aed7a790272cedff055d731e6a45d 100644 (file)
@@ -21,9 +21,9 @@
 //! ChannelMonitors to get out of the HSM and onto monitoring devices.
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::block::Header;
-use bitcoin::blockdata::transaction::{OutPoint as BitcoinOutPoint, TxOut, Transaction};
-use bitcoin::blockdata::script::{Script, ScriptBuf};
+use bitcoin::block::Header;
+use bitcoin::transaction::{OutPoint as BitcoinOutPoint, TxOut, Transaction};
+use bitcoin::script::{Script, ScriptBuf};
 
 use bitcoin::hashes::Hash;
 use bitcoin::hashes::sha256::Hash as Sha256;
@@ -2533,7 +2533,7 @@ macro_rules! fail_unbroadcast_htlcs {
 
 #[cfg(test)]
 pub fn deliberately_bogus_accepted_htlc_witness_program() -> Vec<u8> {
-       use bitcoin::blockdata::opcodes;
+       use bitcoin::opcodes;
        let mut ret = [opcodes::all::OP_NOP.to_u8(); 136];
        ret[131] = opcodes::all::OP_DROP.to_u8();
        ret[132] = opcodes::all::OP_DROP.to_u8();
@@ -4810,11 +4810,11 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
 #[cfg(test)]
 mod tests {
        use bitcoin::amount::Amount;
-       use bitcoin::blockdata::locktime::absolute::LockTime;
-       use bitcoin::blockdata::script::{ScriptBuf, Builder};
-       use bitcoin::blockdata::opcodes;
-       use bitcoin::blockdata::transaction::{Transaction, TxIn, TxOut, Version};
-       use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
+       use bitcoin::locktime::absolute::LockTime;
+       use bitcoin::script::{ScriptBuf, Builder};
+       use bitcoin::opcodes;
+       use bitcoin::transaction::{Transaction, TxIn, TxOut, Version};
+       use bitcoin::transaction::OutPoint as BitcoinOutPoint;
        use bitcoin::sighash;
        use bitcoin::sighash::EcdsaSighashType;
        use bitcoin::hashes::Hash;
index e43c08d55e513a906000d52a2fd6795580bb5037..36b1ce57309777ce5adb56bb835e7285c27c978d 100644 (file)
@@ -9,9 +9,9 @@
 
 //! Structs and traits which allow other parts of rust-lightning to interact with the blockchain.
 
-use bitcoin::blockdata::block::{Block, Header};
-use bitcoin::blockdata::constants::genesis_block;
-use bitcoin::blockdata::script::{Script, ScriptBuf};
+use bitcoin::block::{Block, Header};
+use bitcoin::constants::genesis_block;
+use bitcoin::script::{Script, ScriptBuf};
 use bitcoin::hash_types::{BlockHash, Txid};
 use bitcoin::network::Network;
 use bitcoin::secp256k1::PublicKey;
index 07a75361d67678a8c7011e18c09c805817e5e53d..cfb58c0be186ca4057827a6ee13f737ad0134097 100644 (file)
 //! building, tracking, bumping and notifications functions.
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::transaction::Transaction;
-use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
-use bitcoin::blockdata::script::{Script, ScriptBuf};
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::transaction::Transaction;
+use bitcoin::transaction::OutPoint as BitcoinOutPoint;
+use bitcoin::script::{Script, ScriptBuf};
 use bitcoin::hashes::{Hash, HashEngine};
 use bitcoin::hashes::sha256::Hash as Sha256;
 use bitcoin::hash_types::{Txid, BlockHash};
index 9b40f4b6f5669abab7b07f458cc2626b1d38e095..77ac356680cecc184e9a7d3afa9c778dd0933db6 100644 (file)
 
 use bitcoin::{Sequence, Witness};
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::transaction::{TxOut,TxIn, Transaction};
-use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
-use bitcoin::blockdata::script::{Script, ScriptBuf};
+use bitcoin::constants::WITNESS_SCALE_FACTOR;
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::transaction::{TxOut,TxIn, Transaction};
+use bitcoin::transaction::OutPoint as BitcoinOutPoint;
+use bitcoin::script::{Script, ScriptBuf};
 use bitcoin::hash_types::Txid;
 use bitcoin::secp256k1::{SecretKey,PublicKey};
 use bitcoin::sighash::EcdsaSighashType;
@@ -1201,9 +1201,9 @@ mod tests {
        use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
 
        use bitcoin::amount::Amount;
-       use bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;
-       use bitcoin::blockdata::script::ScriptBuf;
-       use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
+       use bitcoin::constants::WITNESS_SCALE_FACTOR;
+       use bitcoin::script::ScriptBuf;
+       use bitcoin::transaction::OutPoint as BitcoinOutPoint;
 
        use bitcoin::hashes::hex::FromHex;
 
index 13ecf2539a21de1a4c1f5c2409b1f9619e5bc5f0..9533836de890a488978ab870a0c8052f5225af31 100644 (file)
@@ -10,8 +10,8 @@
 //! Types describing on-chain transactions.
 
 use bitcoin::hash_types::Txid;
-use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
-use bitcoin::blockdata::transaction::Transaction;
+use bitcoin::transaction::OutPoint as BitcoinOutPoint;
+use bitcoin::transaction::Transaction;
 
 /// Transaction data where each item consists of a transaction reference paired with the index of
 /// the transaction within a block.
@@ -23,8 +23,8 @@ use bitcoin::blockdata::transaction::Transaction;
 /// extern crate bitcoin;
 /// extern crate lightning;
 ///
-/// use bitcoin::blockdata::block::Block;
-/// use bitcoin::blockdata::constants::genesis_block;
+/// use bitcoin::block::Block;
+/// use bitcoin::constants::genesis_block;
 /// use bitcoin::network::Network;
 /// use lightning::chain::transaction::TransactionData;
 ///
@@ -45,7 +45,7 @@ pub type TransactionData<'a> = [(usize, &'a Transaction)];
 
 /// A reference to a transaction output.
 ///
-/// Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
+/// Differs from bitcoin::transaction::OutPoint as the index is a u16 instead of u32
 /// due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
 pub struct OutPoint {
@@ -90,7 +90,7 @@ mod tests {
        use crate::chain::transaction::OutPoint;
        use crate::ln::types::ChannelId;
 
-       use bitcoin::blockdata::transaction::Transaction;
+       use bitcoin::transaction::Transaction;
        use bitcoin::consensus::encode;
        use bitcoin::hashes::hex::FromHex;
 
index a1ef44c1bc15e0c46342d4beec870ca3766d339f..482a928285c07cff6ca891dc522bdc518afba29d 100644 (file)
@@ -34,8 +34,8 @@ use crate::util::logger::Logger;
 
 use bitcoin::{OutPoint, Psbt, PubkeyHash, Sequence, ScriptBuf, Transaction, TxIn, TxOut, Witness, WPubkeyHash};
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;
-use bitcoin::blockdata::locktime::absolute::LockTime;
+use bitcoin::constants::WITNESS_SCALE_FACTOR;
+use bitcoin::locktime::absolute::LockTime;
 use bitcoin::consensus::Encodable;
 use bitcoin::secp256k1;
 use bitcoin::secp256k1::{PublicKey, Secp256k1};
index 8ac73c75f92ef6252bbf4a3d5f42bede54eb441c..3972ea470da14bfedad3a95b69bda530e7eb21bc 100644 (file)
@@ -36,8 +36,8 @@ use crate::util::ser::{BigSize, FixedLengthReader, Writeable, Writer, MaybeReada
 use crate::util::string::UntrustedString;
 
 use bitcoin::{Transaction, OutPoint};
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::script::ScriptBuf;
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::script::ScriptBuf;
 use bitcoin::hashes::Hash;
 use bitcoin::hashes::sha256::Hash as Sha256;
 use bitcoin::secp256k1::PublicKey;
index 7d95c24076c8a060a4f35002eb5906bb2f95ef00..e96335f37ac263e2dca436e050d0ae474173134c 100644 (file)
@@ -13,7 +13,7 @@
 use std::collections::HashSet;
 
 use bitcoin::{Transaction, TxOut, TxIn, Amount};
-use bitcoin::blockdata::locktime::absolute::LockTime;
+use bitcoin::locktime::absolute::LockTime;
 use bitcoin::transaction::Version;
 
 use crate::chain::channelmonitor::LATENCY_GRACE_PERIOD_BLOCKS;
index ffdbfe919a0c4ed243abfc4fd344827ba18e6e64..cf42d5d84c9f76875ef5fae790af53497d04929c 100644 (file)
@@ -12,9 +12,9 @@
 
 use bitcoin::{PubkeyHash, WPubkeyHash};
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::script::{Script, ScriptBuf, Builder};
-use bitcoin::blockdata::opcodes;
-use bitcoin::blockdata::transaction::{TxIn,TxOut,OutPoint,Transaction};
+use bitcoin::script::{Script, ScriptBuf, Builder};
+use bitcoin::opcodes;
+use bitcoin::transaction::{TxIn,TxOut,OutPoint,Transaction};
 use bitcoin::sighash;
 use bitcoin::sighash::EcdsaSighashType;
 use bitcoin::transaction::Version;
@@ -33,7 +33,7 @@ use crate::ln::msgs::DecodeError;
 use crate::util::ser::{Readable, RequiredWrapper, Writeable, Writer};
 use crate::util::transaction_utils;
 
-use bitcoin::blockdata::locktime::absolute::LockTime;
+use bitcoin::locktime::absolute::LockTime;
 use bitcoin::ecdsa::Signature as BitcoinSignature;
 use bitcoin::secp256k1::{SecretKey, PublicKey, Scalar};
 use bitcoin::secp256k1::{Secp256k1, ecdsa::Signature, Message};
index 06c9c9baafe259b4859350b9a46e312d3fbe6e7f..4a4336d0068222d953819fd1dd556cbfdc0ad1c1 100644 (file)
@@ -12,7 +12,7 @@
 //! There are a bunch of these as their handling is relatively error-prone so they are split out
 //! here. See also the chanmon_fail_consistency fuzz test.
 
-use bitcoin::blockdata::constants::genesis_block;
+use bitcoin::constants::genesis_block;
 use bitcoin::hash_types::BlockHash;
 use bitcoin::network::Network;
 use crate::chain::channelmonitor::{ANTI_REORG_DELAY, ChannelMonitor};
index a8a699c299efdbce280b31314bf3aaef06263789..9abe997890fe0bee01e75f4c3a85dc18ed89aa3c 100644 (file)
@@ -8,9 +8,9 @@
 // licenses.
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::ChainHash;
-use bitcoin::blockdata::script::{Script, ScriptBuf, Builder};
-use bitcoin::blockdata::transaction::Transaction;
+use bitcoin::constants::ChainHash;
+use bitcoin::script::{Script, ScriptBuf, Builder};
+use bitcoin::transaction::Transaction;
 use bitcoin::sighash;
 use bitcoin::sighash::EcdsaSighashType;
 use bitcoin::consensus::encode;
@@ -9586,10 +9586,10 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
 mod tests {
        use std::cmp;
        use bitcoin::amount::Amount;
-       use bitcoin::blockdata::constants::ChainHash;
-       use bitcoin::blockdata::script::{ScriptBuf, Builder};
-       use bitcoin::blockdata::transaction::{Transaction, TxOut, Version};
-       use bitcoin::blockdata::opcodes;
+       use bitcoin::constants::ChainHash;
+       use bitcoin::script::{ScriptBuf, Builder};
+       use bitcoin::transaction::{Transaction, TxOut, Version};
+       use bitcoin::opcodes;
        use bitcoin::network::Network;
        use crate::ln::onion_utils::INVALID_ONION_BLINDING;
        use crate::ln::types::{PaymentHash, PaymentPreimage};
@@ -9619,7 +9619,7 @@ mod tests {
        use bitcoin::hashes::sha256::Hash as Sha256;
        use bitcoin::hashes::Hash;
        use bitcoin::hashes::hex::FromHex;
-       use bitcoin::blockdata::locktime::absolute::LockTime;
+       use bitcoin::locktime::absolute::LockTime;
        use bitcoin::{WitnessProgram, WitnessVersion, WPubkeyHash};
        use crate::prelude::*;
 
index f7d0464b295809cda1ce52e03898679014d94637..103c69f0b6c43801ee74e8aec1853dd24ecaa88d 100644 (file)
@@ -17,9 +17,9 @@
 //! on-chain transactions (it only monitors the chain to watch for any force-closes that might
 //! imply it needs to fail HTLCs/payments/channels it manages).
 
-use bitcoin::blockdata::block::Header;
-use bitcoin::blockdata::transaction::Transaction;
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::block::Header;
+use bitcoin::transaction::Transaction;
+use bitcoin::constants::ChainHash;
 use bitcoin::key::constants::SECRET_KEY_SIZE;
 use bitcoin::network::Network;
 
@@ -14131,7 +14131,7 @@ pub mod bench {
        use crate::util::config::{UserConfig, MaxDustHTLCExposure};
 
        use bitcoin::amount::Amount;
-       use bitcoin::blockdata::locktime::absolute::LockTime;
+       use bitcoin::locktime::absolute::LockTime;
        use bitcoin::hashes::Hash;
        use bitcoin::hashes::sha256::Hash as Sha256;
        use bitcoin::{Transaction, TxOut};
@@ -14169,7 +14169,7 @@ pub mod bench {
                // Note that this is unrealistic as each payment send will require at least two fsync
                // calls per node.
                let network = bitcoin::Network::Testnet;
-               let genesis_block = bitcoin::blockdata::constants::genesis_block(network);
+               let genesis_block = bitcoin::constants::genesis_block(network);
 
                let tx_broadcaster = test_utils::TestBroadcaster::new(network);
                let fee_estimator = test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) };
index 1d351457cb500ae0ac5518575fbfea2d7958ced0..f6e4369242f8690642551e97e57237d3b15d31b0 100644 (file)
@@ -38,9 +38,9 @@ use crate::util::test_utils::{panicking, TestChainMonitor, TestScorer, TestKeysI
 use crate::util::ser::{ReadableArgs, Writeable};
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::block::{Block, Header, Version};
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::transaction::{Transaction, TxIn, TxOut};
+use bitcoin::block::{Block, Header, Version};
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::transaction::{Transaction, TxIn, TxOut};
 use bitcoin::hash_types::{BlockHash, TxMerkleNode};
 use bitcoin::hashes::sha256::Hash as Sha256;
 use bitcoin::hashes::Hash as _;
@@ -1523,7 +1523,7 @@ pub fn update_nodes_with_chan_announce<'a, 'b, 'c, 'd>(nodes: &'a Vec<Node<'b, '
        }
 }
 
-pub fn do_check_spends<F: Fn(&bitcoin::blockdata::transaction::OutPoint) -> Option<TxOut>>(tx: &Transaction, get_output: F) {
+pub fn do_check_spends<F: Fn(&bitcoin::transaction::OutPoint) -> Option<TxOut>>(tx: &Transaction, get_output: F) {
        for outp in tx.output.iter() {
                assert!(outp.value >= outp.script_pubkey.dust_value(), "Spending tx output didn't meet dust limit");
        }
@@ -1550,7 +1550,7 @@ macro_rules! check_spends {
                                assert!(outp.value >= outp.script_pubkey.dust_value(), "Input tx output didn't meet dust limit");
                        }
                        )*
-                       let get_output = |out_point: &bitcoin::blockdata::transaction::OutPoint| {
+                       let get_output = |out_point: &bitcoin::transaction::OutPoint| {
                                $(
                                        if out_point.txid == $spends_txn.txid() {
                                                return $spends_txn.output.get(out_point.vout as usize).cloned()
@@ -3252,7 +3252,7 @@ pub fn create_node_chanmgrs<'a, 'b>(node_count: usize, cfgs: &'a Vec<NodeCfg<'b>
        let mut chanmgrs = Vec::new();
        for i in 0..node_count {
                let network = Network::Testnet;
-               let genesis_block = bitcoin::blockdata::constants::genesis_block(network);
+               let genesis_block = bitcoin::constants::genesis_block(network);
                let params = ChainParameters {
                        network,
                        best_block: BestBlock::from_network(network),
index 40f114ecfa969d2dba03a89dbfb3660bd9426290..b98653487195b372a794e96d741c3637fb97f1ed 100644 (file)
@@ -38,10 +38,10 @@ use crate::util::string::UntrustedString;
 use crate::util::config::{UserConfig, MaxDustHTLCExposure};
 
 use bitcoin::hash_types::BlockHash;
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::script::{Builder, ScriptBuf};
-use bitcoin::blockdata::opcodes;
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::script::{Builder, ScriptBuf};
+use bitcoin::opcodes;
+use bitcoin::constants::ChainHash;
 use bitcoin::network::Network;
 use bitcoin::{Amount, Sequence, Transaction, TxIn, TxOut, Witness};
 use bitcoin::OutPoint as BitcoinOutPoint;
index ce4825902c7cec29f29e8f08913cc8ccc09f6b09..6bb5582227c495f16daabe8427a6458137868ce5 100644 (file)
@@ -12,7 +12,7 @@ use crate::prelude::*;
 
 use bitcoin::absolute::LockTime as AbsoluteLockTime;
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;
+use bitcoin::constants::WITNESS_SCALE_FACTOR;
 use bitcoin::consensus::Encodable;
 use bitcoin::policy::MAX_STANDARD_TX_WEIGHT;
 use bitcoin::transaction::Version;
@@ -1304,8 +1304,8 @@ mod tests {
        use crate::util::ser::TransactionU16LenLimited;
        use bitcoin::absolute::LockTime as AbsoluteLockTime;
        use bitcoin::amount::Amount;
-       use bitcoin::blockdata::opcodes;
-       use bitcoin::blockdata::script::Builder;
+       use bitcoin::opcodes;
+       use bitcoin::script::Builder;
        use bitcoin::hashes::Hash;
        use bitcoin::key::UntweakedPublicKey;
        use bitcoin::secp256k1::{Keypair, Secp256k1};
index c2764e27f550ce6ae30287fef831a687e6e66fe5..7b43bf037395f71277390cc394dc9dd391a5ce9d 100644 (file)
@@ -25,9 +25,9 @@ use crate::util::scid_utils::block_from_scid;
 use crate::util::test_utils;
 
 use bitcoin::{Amount, PublicKey, ScriptBuf, Transaction, TxIn, TxOut, Witness};
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::script::Builder;
-use bitcoin::blockdata::opcodes;
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::script::Builder;
+use bitcoin::opcodes;
 use bitcoin::hashes::hex::FromHex;
 use bitcoin::secp256k1::{Secp256k1, SecretKey};
 use bitcoin::sighash::{SighashCache, EcdsaSighashType};
index 80cdb44afe982b773ca59887c35ccfbd1fe42892..a41072add6ed2f5c890908ff5172c6a18907ff41 100644 (file)
 //! raw socket events into your non-internet-facing system and then send routing events back to
 //! track the network on the less-secure system.
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::secp256k1::PublicKey;
 use bitcoin::secp256k1::ecdsa::Signature;
 use bitcoin::{secp256k1, Witness};
-use bitcoin::blockdata::script::ScriptBuf;
+use bitcoin::script::ScriptBuf;
 use bitcoin::hash_types::Txid;
 
 use crate::blinded_path::payment::{BlindedPaymentTlvs, ForwardTlvs, ReceiveTlvs};
@@ -3279,9 +3279,9 @@ mod tests {
        use bitcoin::hashes::hex::FromHex;
        use bitcoin::address::Address;
        use bitcoin::network::Network;
-       use bitcoin::blockdata::constants::ChainHash;
-       use bitcoin::blockdata::script::Builder;
-       use bitcoin::blockdata::opcodes;
+       use bitcoin::constants::ChainHash;
+       use bitcoin::script::Builder;
+       use bitcoin::opcodes;
        use bitcoin::hash_types::Txid;
        use bitcoin::locktime::absolute::LockTime;
        use bitcoin::transaction::Version;
index 91c60117cb17fb23c1e5b7eae1f87a15f0da89cc..485f05a35414370a13bc6f30c2b94c6fc9b033a7 100644 (file)
@@ -30,7 +30,7 @@ use crate::util::test_utils;
 use crate::util::config::{UserConfig, ChannelConfig, MaxDustHTLCExposure};
 use crate::util::errors::APIError;
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::hashes::{Hash, HashEngine};
 use bitcoin::hashes::hmac::{Hmac, HmacEngine};
 use bitcoin::hashes::sha256::Hash as Sha256;
index 3be4d287aef817dc2ab73dbfbcc270ac465531c1..b4c242627371b6d636b91ab18386376431a3ed6b 100644 (file)
@@ -15,7 +15,7 @@
 //! call into the provided message handlers (probably a ChannelManager and P2PGossipSync) with
 //! messages they should handle, and encoding/sending response messages.
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::secp256k1::{self, Secp256k1, SecretKey, PublicKey};
 
 use crate::blinded_path::message::OffersContext;
@@ -2712,7 +2712,7 @@ mod tests {
        use crate::util::test_utils;
 
        use bitcoin::Network;
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::secp256k1::{PublicKey, SecretKey};
 
        use crate::sync::{Arc, Mutex};
index 1c4401cd48822332d5fa0acdefbe192c2909badc..62896cbaa934e84458c64cafe08bcfa5b6f9c3b0 100644 (file)
@@ -30,7 +30,7 @@ use crate::prelude::*;
 
 use crate::ln::functional_test_utils::*;
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::network::Network;
 
 #[test]
index e54577849c4d08c9c44282a91df832779b5984f8..487822565bd52a575e31fb2d9d6b11f64a25053f 100644 (file)
@@ -21,8 +21,8 @@ use crate::util::test_utils;
 use crate::util::ser::Writeable;
 use crate::util::string::UntrustedString;
 
-use bitcoin::blockdata::script::Builder;
-use bitcoin::blockdata::opcodes;
+use bitcoin::script::Builder;
+use bitcoin::opcodes;
 use bitcoin::secp256k1::Secp256k1;
 
 use crate::prelude::*;
index 190e243a7a5e1cd2f383ac89844d3d11a911f1cd..0c33a1498edc886ffa370f18e54091457825df7a 100644 (file)
@@ -1,8 +1,8 @@
 //! Abstractions for scripts used in the Lightning Network.
 
 use bitcoin::{WitnessProgram, WPubkeyHash, WScriptHash};
-use bitcoin::blockdata::opcodes::all::OP_PUSHBYTES_0 as SEGWIT_V0;
-use bitcoin::blockdata::script::{Script, ScriptBuf};
+use bitcoin::opcodes::all::OP_PUSHBYTES_0 as SEGWIT_V0;
+use bitcoin::script::{Script, ScriptBuf};
 use bitcoin::hashes::Hash;
 use bitcoin::secp256k1::PublicKey;
 
@@ -170,8 +170,8 @@ mod shutdown_script_tests {
        use super::ShutdownScript;
 
        use bitcoin::{WitnessProgram, WitnessVersion};
-       use bitcoin::blockdata::opcodes;
-       use bitcoin::blockdata::script::{Builder, ScriptBuf};
+       use bitcoin::opcodes;
+       use bitcoin::script::{Builder, ScriptBuf};
        use bitcoin::secp256k1::Secp256k1;
        use bitcoin::secp256k1::{PublicKey, SecretKey};
 
index df6694a2df3fe785ed14ec1f45eb35d8d01194ab..b86c3482f01146e05af425ddc01b7de095e61e3b 100644 (file)
@@ -31,9 +31,9 @@ use crate::prelude::*;
 
 use bitcoin::{Transaction, TxOut, WitnessProgram, WitnessVersion};
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::script::Builder;
-use bitcoin::blockdata::opcodes;
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::script::Builder;
+use bitcoin::opcodes;
 use bitcoin::network::Network;
 use bitcoin::transaction::Version;
 
index 76a4769cb58a1d783a6c8b63361242512a45d649..835a077f294b97a3b60b19e22d5e529af052430c 100644 (file)
 //! ```
 
 use bitcoin::{WitnessProgram, Network, WitnessVersion};
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::secp256k1::{Keypair, PublicKey, Secp256k1, self};
 use bitcoin::secp256k1::schnorr::Signature;
 use bitcoin::address::{Address, Payload};
@@ -1423,8 +1423,8 @@ mod tests {
        use super::{Bolt12Invoice, DEFAULT_RELATIVE_EXPIRY, FallbackAddress, FullInvoiceTlvStreamRef, InvoiceTlvStreamRef, SIGNATURE_TAG, UnsignedBolt12Invoice};
 
        use bitcoin::{WitnessProgram, WitnessVersion};
-       use bitcoin::blockdata::constants::ChainHash;
-       use bitcoin::blockdata::script::ScriptBuf;
+       use bitcoin::constants::ChainHash;
+       use bitcoin::script::ScriptBuf;
        use bitcoin::hashes::Hash;
        use bitcoin::network::Network;
        use bitcoin::secp256k1::{Keypair, Message, Secp256k1, SecretKey, XOnlyPublicKey, self};
index de9c9c2db31743827732a24d4a5ba444163be4f4..6ed9b2a1295086f6598a404047df0667ad527027 100644 (file)
@@ -57,7 +57,7 @@
 //! # }
 //! ```
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::network::Network;
 use bitcoin::secp256k1::{Keypair, PublicKey, Secp256k1, self};
 use bitcoin::secp256k1::schnorr::Signature;
@@ -1232,7 +1232,7 @@ impl Readable for InvoiceRequestFields {
 mod tests {
        use super::{InvoiceRequest, InvoiceRequestFields, InvoiceRequestTlvStreamRef, PAYER_NOTE_LIMIT, SIGNATURE_TAG, UnsignedInvoiceRequest};
 
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::network::Network;
        use bitcoin::secp256k1::{Keypair, Secp256k1, SecretKey, self};
        use core::num::NonZeroU64;
index 24f0346885c1b33994a81e35576cb30ee898ef2f..e314f712c2d24133e4aedce4705139709085e6ee 100644 (file)
@@ -77,7 +77,7 @@
 //! [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
 //! [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::network::Network;
 use bitcoin::secp256k1::{Keypair, PublicKey, Secp256k1, self};
 use core::hash::{Hash, Hasher};
@@ -580,7 +580,7 @@ macro_rules! offer_accessors { ($self: ident, $contents: expr) => {
        /// The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
        /// Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
        /// for the selected chain.
-       pub fn chains(&$self) -> Vec<bitcoin::blockdata::constants::ChainHash> {
+       pub fn chains(&$self) -> Vec<bitcoin::constants::ChainHash> {
                $contents.chains()
        }
 
@@ -1172,7 +1172,7 @@ mod tests {
                super::OfferWithExplicitMetadataBuilder as OfferBuilder,
        };
 
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::network::Network;
        use bitcoin::secp256k1::Secp256k1;
        use core::num::NonZeroU64;
index 242652577bd88e78cc620d4427e6e2e68c8adcb4..10f56f0a14ce638f50766eea5f157cfde1f443de 100644 (file)
@@ -82,7 +82,7 @@
 //! [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
 //! [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::network::Network;
 use bitcoin::secp256k1::{PublicKey, Secp256k1, self};
 use core::hash::{Hash, Hasher};
@@ -931,7 +931,7 @@ mod tests {
                super::RefundMaybeWithDerivedMetadataBuilder as RefundBuilder,
        };
 
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::network::Network;
        use bitcoin::secp256k1::{Keypair, Secp256k1, SecretKey};
 
index 555b878a6704b5cbbdb30691134721f2517ad732..614903bdfcc1f125671e58aaa418d4a5c7239282 100644 (file)
@@ -30,7 +30,7 @@ use crate::offers::parse::{Bolt12ParseError, Bolt12SemanticError, ParsedMessage}
 use crate::util::ser::{Iterable, SeekReadable, WithoutLength, Writeable, Writer};
 use crate::util::string::PrintableString;
 use bitcoin::address::Address;
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::secp256k1::schnorr::Signature;
 use bitcoin::secp256k1::{self, Keypair, PublicKey, Secp256k1};
 use core::time::Duration;
@@ -575,7 +575,7 @@ mod tests {
        use crate::offers::test_utils::*;
        use crate::sign::KeyMaterial;
        use crate::util::ser::{BigSize, Iterable, Writeable};
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::secp256k1::{self, Secp256k1};
        use bitcoin::Network;
        use core::time::Duration;
index 15981e25af77fb1def976d7f4c64e8031e770682..f058aa7470681d313fdf81178eec49312e821bc8 100644 (file)
@@ -10,7 +10,7 @@
 //! The [`NetworkGraph`] stores the network gossip and [`P2PGossipSync`] fetches it from peers
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 
 use bitcoin::secp256k1;
 use bitcoin::secp256k1::constants::PUBLIC_KEY_SIZE;
@@ -2433,9 +2433,9 @@ pub(crate) mod tests {
        use bitcoin::hashes::hex::FromHex;
        use bitcoin::network::Network;
        use bitcoin::amount::Amount;
-       use bitcoin::blockdata::constants::ChainHash;
-       use bitcoin::blockdata::script::ScriptBuf;
-       use bitcoin::blockdata::transaction::TxOut;
+       use bitcoin::constants::ChainHash;
+       use bitcoin::script::ScriptBuf;
+       use bitcoin::transaction::TxOut;
        use bitcoin::secp256k1::{PublicKey, SecretKey};
        use bitcoin::secp256k1::{All, Secp256k1};
 
index 71fde86d0b6964b4ad75d167c62b02001134c9e6..d7c665ff117739a6b4d1feec2122ad5d9c95ffac 100644 (file)
@@ -3594,10 +3594,10 @@ mod tests {
        use bitcoin::amount::Amount;
        use bitcoin::hashes::Hash;
        use bitcoin::network::Network;
-       use bitcoin::blockdata::constants::ChainHash;
-       use bitcoin::blockdata::script::Builder;
-       use bitcoin::blockdata::opcodes;
-       use bitcoin::blockdata::transaction::TxOut;
+       use bitcoin::constants::ChainHash;
+       use bitcoin::script::Builder;
+       use bitcoin::opcodes;
+       use bitcoin::transaction::TxOut;
        use bitcoin::hashes::hex::FromHex;
        use bitcoin::secp256k1::{PublicKey,SecretKey};
        use bitcoin::secp256k1::Secp256k1;
index 85b347086f385b7a478e1b880f50cbae5bb5b8cf..a04a1850489c4be4b985e2a8af4eda5e1922b789 100644 (file)
@@ -2163,7 +2163,7 @@ mod tests {
        use crate::util::ser::{ReadableArgs, Writeable};
        use crate::util::test_utils::{self, TestLogger};
 
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::hashes::Hash;
        use bitcoin::hashes::sha256d::Hash as Sha256dHash;
        use bitcoin::network::Network;
index e109649947a370db763f796d6108e59bbc30eb6c..939352cf53f8ee2c8441ba0ea19579eadd57caf4 100644 (file)
@@ -13,7 +13,7 @@ use crate::ln::msgs::{ChannelAnnouncement, ChannelUpdate, MAX_VALUE_MSAT, NodeAn
 use crate::util::test_utils;
 use crate::util::ser::Writeable;
 
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 use bitcoin::hashes::sha256d::Hash as Sha256dHash;
 use bitcoin::hashes::Hash;
 use bitcoin::hashes::hex::FromHex;
index 2254751209a8583a858062823ead39a8cf1696a1..a8fe58831847625e6300708a4b1a91b077dd9e7a 100644 (file)
@@ -15,7 +15,7 @@
 
 use bitcoin::TxOut;
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::ChainHash;
+use bitcoin::constants::ChainHash;
 
 use hex::DisplayHex;
 
index df2b40332c30fa8d27c8a9f853b936f461ec5bfd..ecdd45aa3f5e0b5b401843bff17327aa04dbdaec 100644 (file)
@@ -1,6 +1,6 @@
 //! Defines ECDSA-specific signer types.
 
-use bitcoin::blockdata::transaction::Transaction;
+use bitcoin::transaction::Transaction;
 
 use bitcoin::secp256k1;
 use bitcoin::secp256k1::ecdsa::Signature;
index 68834fb7ba204ee389f6d744257ea296373eb009..99c328d601049e1e4c196d587ed3b87b83a274b3 100644 (file)
 
 use bitcoin::amount::Amount;
 use bitcoin::bip32::{ChildNumber, Xpriv, Xpub};
-use bitcoin::blockdata::locktime::absolute::LockTime;
-use bitcoin::blockdata::opcodes;
-use bitcoin::blockdata::script::{Builder, Script, ScriptBuf};
-use bitcoin::blockdata::transaction::{Transaction, TxIn, TxOut};
+use bitcoin::locktime::absolute::LockTime;
+use bitcoin::opcodes;
+use bitcoin::script::{Builder, Script, ScriptBuf};
+use bitcoin::transaction::{Transaction, TxIn, TxOut};
 use bitcoin::ecdsa::Signature as EcdsaSignature;
 use bitcoin::network::Network;
 use bitcoin::sighash;
@@ -2516,7 +2516,7 @@ pub fn dyn_sign() {
 #[cfg(ldk_bench)]
 pub mod benches {
        use crate::sign::{EntropySource, KeysManager};
-       use bitcoin::blockdata::constants::genesis_block;
+       use bitcoin::constants::genesis_block;
        use bitcoin::Network;
        use std::sync::mpsc::TryRecvError;
        use std::sync::{mpsc, Arc};
index 7536b68a8793b59dc79a0a7661fdef8881712c4e..95f41751467c0cf1f169dfe7c6b78b3564cec076 100644 (file)
@@ -1,7 +1,7 @@
 //! Defines a Taproot-specific signer type.
 
 use alloc::vec::Vec;
-use bitcoin::blockdata::transaction::Transaction;
+use bitcoin::transaction::Transaction;
 use bitcoin::secp256k1;
 use bitcoin::secp256k1::{schnorr::Signature, PublicKey, Secp256k1, SecretKey};
 
index 123452806107c1a4c957ebe5a80c2994dea15fc5..d8f7ee3b6f25b79a74b665ce2f98b3b9445cfd19 100644 (file)
@@ -10,7 +10,7 @@
 use crate::ln::types::ChannelId;
 use crate::sign::SpendableOutputDescriptor;
 
-use bitcoin::blockdata::transaction::Transaction;
+use bitcoin::transaction::Transaction;
 
 use crate::routing::router::Route;
 use crate::ln::chan_utils::HTLCClaim;
index ce789ef9fdc6fd7eb2b23f04f7c66ff379238ac5..4e3fa37dcf0c81e4268dc99e4ca7e8c59071f514 100644 (file)
@@ -71,7 +71,7 @@ pub fn scid_from_parts(block: u64, tx_index: u64, vout_index: u64) -> Result<u64
 /// 3) payments intended to be intercepted will route using a fake scid (this is typically used so
 ///    the forwarding node can open a JIT channel to the next hop)
 pub(crate) mod fake_scid {
-       use bitcoin::blockdata::constants::ChainHash;
+       use bitcoin::constants::ChainHash;
        use bitcoin::Network;
        use crate::sign::EntropySource;
        use crate::crypto::chacha20::ChaCha20;
@@ -182,7 +182,7 @@ pub(crate) mod fake_scid {
 
        #[cfg(test)]
        mod tests {
-               use bitcoin::blockdata::constants::ChainHash;
+               use bitcoin::constants::ChainHash;
                use bitcoin::network::Network;
                use crate::util::scid_utils::fake_scid::{is_valid_intercept, is_valid_phantom, MAINNET_SEGWIT_ACTIVATION_HEIGHT, MAX_TX_INDEX, MAX_NAMESPACES, Namespace, NAMESPACE_ID_BITMASK, segwit_activation_height, TEST_SEGWIT_ACTIVATION_HEIGHT};
                use crate::util::scid_utils;
index 5f109e1a93c64529d09e462899fb539abf662c68..2dda215237b1ac73194ac81ed593bbc27d873265 100644 (file)
@@ -28,9 +28,9 @@ use bitcoin::secp256k1::constants::{PUBLIC_KEY_SIZE, SECRET_KEY_SIZE, COMPACT_SI
 use bitcoin::secp256k1::ecdsa;
 use bitcoin::secp256k1::schnorr;
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::ChainHash;
-use bitcoin::blockdata::script::{self, ScriptBuf};
-use bitcoin::blockdata::transaction::{OutPoint, Transaction, TxOut};
+use bitcoin::constants::ChainHash;
+use bitcoin::script::{self, ScriptBuf};
+use bitcoin::transaction::{OutPoint, Transaction, TxOut};
 use bitcoin::{consensus, Witness};
 use bitcoin::consensus::Encodable;
 use bitcoin::hashes::sha256d::Hash as Sha256dHash;
index 1e04eb59bf8eca4eb800670d350933c19e292017..2c01e1ecc399e386a8c27702aa506172568084a7 100644 (file)
@@ -25,8 +25,8 @@ use crate::util::persist::{
 use crate::util::ser::{Readable, ReadableArgs, Writeable};
 use crate::{impl_writeable_tlv_based, log_debug, log_error};
 
-use bitcoin::blockdata::block::Header;
-use bitcoin::blockdata::locktime::absolute::LockTime;
+use bitcoin::block::Header;
+use bitcoin::locktime::absolute::LockTime;
 use bitcoin::secp256k1::Secp256k1;
 use bitcoin::{BlockHash, Transaction, Txid};
 
index 0f8eb44f74aa410ce0578c9b30cb1a1d0b19e8cd..c62b81f307d4dfc5792799c23ae32f12d828a535 100644 (file)
@@ -22,7 +22,7 @@ use core::cmp;
 use crate::sync::{Mutex, Arc};
 #[cfg(test)] use crate::sync::MutexGuard;
 
-use bitcoin::blockdata::transaction::Transaction;
+use bitcoin::transaction::Transaction;
 use bitcoin::hashes::Hash;
 use bitcoin::sighash;
 use bitcoin::sighash::EcdsaSighashType;
index 74a7f769df1bafb9d4ef58ee2cfac78f0b20073d..113006cbb1cd2cfdcaa74dff59bca1eb7336bb98 100644 (file)
@@ -49,12 +49,12 @@ use crate::util::ser::{Readable, ReadableArgs, Writer, Writeable};
 use crate::util::persist::KVStore;
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::constants::ChainHash;
-use bitcoin::blockdata::constants::genesis_block;
-use bitcoin::blockdata::transaction::{Transaction, TxOut};
-use bitcoin::blockdata::script::{Builder, Script, ScriptBuf};
-use bitcoin::blockdata::opcodes;
-use bitcoin::blockdata::block::Block;
+use bitcoin::constants::ChainHash;
+use bitcoin::constants::genesis_block;
+use bitcoin::transaction::{Transaction, TxOut};
+use bitcoin::script::{Builder, Script, ScriptBuf};
+use bitcoin::opcodes;
+use bitcoin::block::Block;
 use bitcoin::network::Network;
 use bitcoin::hash_types::{BlockHash, Txid};
 use bitcoin::hashes::Hash;
index 5eb7ba3b94966a16ef9d927f6dcb6d117035b936..99c556f6314b3f7da38887b5aa5fcee5a1b211bd 100644 (file)
@@ -8,8 +8,8 @@
 // licenses.
 
 use bitcoin::amount::Amount;
-use bitcoin::blockdata::transaction::{Transaction, TxOut};
-use bitcoin::blockdata::script::ScriptBuf;
+use bitcoin::transaction::{Transaction, TxOut};
+use bitcoin::script::ScriptBuf;
 use bitcoin::consensus::Encodable;
 use bitcoin::consensus::encode::VarInt;
 
@@ -73,9 +73,9 @@ mod tests {
        use super::*;
 
        use bitcoin::amount::Amount;
-       use bitcoin::blockdata::locktime::absolute::LockTime;
-       use bitcoin::blockdata::transaction::{TxIn, OutPoint, Version};
-       use bitcoin::blockdata::script::Builder;
+       use bitcoin::locktime::absolute::LockTime;
+       use bitcoin::transaction::{TxIn, OutPoint, Version};
+       use bitcoin::script::Builder;
        use bitcoin::hash_types::Txid;
        use bitcoin::hashes::Hash;
        use bitcoin::hashes::hex::FromHex;