Skip to content

Commit 309a607

Browse files
committed
fix(wallet, chain)!: use bitcoin::constants::COINBASE_MATURITY
1 parent b8c736c commit 309a607

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

crates/chain/src/chain_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use bitcoin::{OutPoint, TxOut, Txid};
1+
use bitcoin::{constants::COINBASE_MATURITY, OutPoint, TxOut, Txid};
22

3-
use crate::{Anchor, COINBASE_MATURITY};
3+
use crate::Anchor;
44

55
/// Represents the observed position of some chain data.
66
///

crates/chain/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ pub extern crate serde;
7777
#[macro_use]
7878
extern crate std;
7979

80-
/// How many confirmations are needed f or a coinbase output to be spent.
81-
pub const COINBASE_MATURITY: u32 = 100;
82-
8380
/// A wrapper that we use to impl remote traits for types in our crate or dependency crates.
8481
pub struct Impl<T>(pub T);
8582

crates/wallet/src/wallet/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use bdk_chain::{
3636
use bitcoin::{
3737
absolute,
3838
consensus::encode::serialize,
39-
constants::genesis_block,
39+
constants::{genesis_block, COINBASE_MATURITY},
4040
psbt,
4141
secp256k1::Secp256k1,
4242
sighash::{EcdsaSighashType, TapSighashType},
@@ -86,8 +86,6 @@ pub use params::*;
8686
pub use persisted::*;
8787
pub use utils::IsDust;
8888

89-
const COINBASE_MATURITY: u32 = 100;
90-
9189
/// A Bitcoin wallet
9290
///
9391
/// The `Wallet` acts as a way of coherently interfacing with output descriptors and related transactions.

crates/wallet/tests/wallet.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::sync::Arc;
44

55
use anyhow::Context;
66
use assert_matches::assert_matches;
7-
use bdk_chain::COINBASE_MATURITY;
87
use bdk_chain::{BlockId, ChainPosition, ConfirmationBlockTime};
98
use bdk_wallet::coin_selection::{self, LargestFirstCoinSelection};
109
use bdk_wallet::descriptor::{calc_checksum, DescriptorError, IntoWalletDescriptor};
@@ -15,7 +14,7 @@ use bdk_wallet::test_utils::*;
1514
use bdk_wallet::tx_builder::AddForeignUtxoError;
1615
use bdk_wallet::{AddressInfo, Balance, ChangeSet, Wallet, WalletPersister, WalletTx};
1716
use bdk_wallet::{KeychainKind, LoadError, LoadMismatch, LoadWithPersistError};
18-
use bitcoin::constants::ChainHash;
17+
use bitcoin::constants::{ChainHash, COINBASE_MATURITY};
1918
use bitcoin::hashes::Hash;
2019
use bitcoin::key::Secp256k1;
2120
use bitcoin::psbt;

0 commit comments

Comments
 (0)