Skip to content

Commit

Permalink
Merge bitcoindevkit#1727: Use bitcoin::constants::COINBASE_MATURITY
Browse files Browse the repository at this point in the history
309a607 fix(wallet, chain)!: use `bitcoin::constants::COINBASE_MATURITY` (Rob N)

Pull request description:

  Closes bitcoindevkit#1692

  #### 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

  #### New Features:

  * [ ] I've added tests for the new feature
  * [ ] I've added docs for the new feature

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  notmandatory:
    ACK 309a607
  oleonardolima:
    ACK 309a607

Tree-SHA512: 2e97ead256a34dff8130568e82b56214be975513a210b498ff8ac2d5fd7242d3f3d911d2ada8ce9ec04db4f5f87f9144ea1728784bd5c1581ee3b92a4c7188b7
  • Loading branch information
notmandatory committed Nov 21, 2024
2 parents c42b01b + 309a607 commit 35e7051
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crates/chain/src/chain_data.rs
Original file line number Diff line number Diff line change
@@ -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.
///
Expand Down
3 changes: 0 additions & 3 deletions crates/chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 1 addition & 3 deletions crates/wallet/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions crates/wallet/tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;
Expand Down

0 comments on commit 35e7051

Please sign in to comment.