]> Untitled Git - bdk/commitdiff
fix(wallet, chain)!: use `bitcoin::constants::COINBASE_MATURITY`
authorRob N <rob.netzke@gmail.com>
Sat, 16 Nov 2024 22:34:21 +0000 (12:34 -1000)
committerRob N <rob.netzke@gmail.com>
Tue, 19 Nov 2024 02:37:39 +0000 (16:37 -1000)
crates/chain/src/chain_data.rs
crates/chain/src/lib.rs
crates/wallet/src/wallet/mod.rs
crates/wallet/tests/wallet.rs

index e0202e1afd92267b443555e9efb1a92101b6b4db..efdb7a09935975a6c703c2edfe427237e04b6e55 100644 (file)
@@ -1,6 +1,6 @@
-use bitcoin::{OutPoint, TxOut, Txid};
+use bitcoin::{constants::COINBASE_MATURITY, OutPoint, TxOut, Txid};
 
-use crate::{Anchor, COINBASE_MATURITY};
+use crate::Anchor;
 
 /// Represents the observed position of some chain data.
 ///
index 9667bb5498f7c0799a60c39477ec350f3cffff14..8d87da58358a611f8f2cd532e6c19aaf87c64738 100644 (file)
@@ -77,9 +77,6 @@ pub extern crate serde;
 #[macro_use]
 extern crate std;
 
-/// How many confirmations are needed f or a coinbase output to be spent.
-pub const COINBASE_MATURITY: u32 = 100;
-
 /// A wrapper that we use to impl remote traits for types in our crate or dependency crates.
 pub struct Impl<T>(pub T);
 
index 68d5e6bec28cc44ec6cb0f35d68d2c68e8877552..136312e9a0ab0b9e5069d4a802833cb9eb07aa50 100644 (file)
@@ -36,7 +36,7 @@ use bdk_chain::{
 use bitcoin::{
     absolute,
     consensus::encode::serialize,
-    constants::genesis_block,
+    constants::{genesis_block, COINBASE_MATURITY},
     psbt,
     secp256k1::Secp256k1,
     sighash::{EcdsaSighashType, TapSighashType},
@@ -86,8 +86,6 @@ pub use params::*;
 pub use persisted::*;
 pub use utils::IsDust;
 
-const COINBASE_MATURITY: u32 = 100;
-
 /// A Bitcoin wallet
 ///
 /// The `Wallet` acts as a way of coherently interfacing with output descriptors and related transactions.
index 6bfae2ec739a2191fd6af0cf6f9bbaed3f7405a9..bc8ee4d4946ac09c0777b427a7d61cd2eae8e29d 100644 (file)
@@ -4,7 +4,6 @@ use std::sync::Arc;
 
 use anyhow::Context;
 use assert_matches::assert_matches;
-use bdk_chain::COINBASE_MATURITY;
 use bdk_chain::{BlockId, ChainPosition, ConfirmationBlockTime};
 use bdk_wallet::coin_selection::{self, LargestFirstCoinSelection};
 use bdk_wallet::descriptor::{calc_checksum, DescriptorError, IntoWalletDescriptor};
@@ -15,7 +14,7 @@ use bdk_wallet::test_utils::*;
 use bdk_wallet::tx_builder::AddForeignUtxoError;
 use bdk_wallet::{AddressInfo, Balance, ChangeSet, Wallet, WalletPersister, WalletTx};
 use bdk_wallet::{KeychainKind, LoadError, LoadMismatch, LoadWithPersistError};
-use bitcoin::constants::ChainHash;
+use bitcoin::constants::{ChainHash, COINBASE_MATURITY};
 use bitcoin::hashes::Hash;
 use bitcoin::key::Secp256k1;
 use bitcoin::psbt;