diff --git a/crates/chain/src/chain_data.rs b/crates/chain/src/chain_data.rs index e0202e1af..efdb7a099 100644 --- a/crates/chain/src/chain_data.rs +++ b/crates/chain/src/chain_data.rs @@ -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. /// diff --git a/crates/chain/src/lib.rs b/crates/chain/src/lib.rs index 9667bb549..8d87da583 100644 --- a/crates/chain/src/lib.rs +++ b/crates/chain/src/lib.rs @@ -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(pub T); diff --git a/crates/wallet/src/wallet/mod.rs b/crates/wallet/src/wallet/mod.rs index 68d5e6bec..136312e9a 100644 --- a/crates/wallet/src/wallet/mod.rs +++ b/crates/wallet/src/wallet/mod.rs @@ -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. diff --git a/crates/wallet/tests/wallet.rs b/crates/wallet/tests/wallet.rs index 6bfae2ec7..bc8ee4d49 100644 --- a/crates/wallet/tests/wallet.rs +++ b/crates/wallet/tests/wallet.rs @@ -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;