Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a public method and removing it breaks the public API.

Could you add pub use bitcoin::constants::COINBASE_MATURITY in the top of this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure if stylistic or for another reason, but BDK does not export types via pub use anywhere else in the crate. What do you think @notmandatory @ValuedMammal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's a breaking change on the API, it's fixing the API and you can use it from rust-bitcoin (e.g. bdk_chain::bitcoin::constants::COINBASE_MATURITY), which is re-exported.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is a breaking change, but it's OK to require downstream projects to switch to explicitly use bdk_chain::bitcoin::constants::COINBASE_MATURITY since we'll be rolling this out in the 1.0.0 major release.

/// 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
Loading