Skip to content

Commit d1bf88b

Browse files
committed
chore: organize some imports
In particular, separate top-level bitcoin types from those nested in submodules
1 parent 7392ddf commit d1bf88b

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

crates/bdk/src/wallet/tx_builder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ use core::cell::RefCell;
4848
use core::fmt;
4949
use core::marker::PhantomData;
5050

51+
use bitcoin::absolute;
5152
use bitcoin::psbt::{self, PartiallySignedTransaction as Psbt};
52-
use bitcoin::{absolute, script::PushBytes, OutPoint, ScriptBuf, Sequence, Transaction, Txid};
53+
use bitcoin::script::PushBytes;
54+
use bitcoin::{FeeRate, OutPoint, ScriptBuf, Sequence, Transaction, Txid};
5355

5456
use super::coin_selection::{CoinSelectionAlgorithm, DefaultCoinSelectionAlgorithm};
5557
use super::ChangeSet;
5658
use crate::types::{KeychainKind, LocalUtxo, WeightedUtxo};
5759
use crate::wallet::CreateTxError;
5860
use crate::{Utxo, Wallet};
59-
use bitcoin::FeeRate;
61+
6062
/// Context in which the [`TxBuilder`] is valid
6163
pub trait TxBuilderContext: core::fmt::Debug + Default + Clone {}
6264

crates/bdk/tests/wallet.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ use bdk::wallet::{AddressIndex, AddressInfo, Balance, Wallet};
1212
use bdk::KeychainKind;
1313
use bdk_chain::COINBASE_MATURITY;
1414
use bdk_chain::{BlockId, ConfirmationTime};
15+
use bitcoin::absolute;
1516
use bitcoin::hashes::Hash;
17+
use bitcoin::psbt;
18+
use bitcoin::script::PushBytesBuf;
1619
use bitcoin::sighash::{EcdsaSighashType, TapSighashType};
17-
use bitcoin::Amount;
18-
use bitcoin::FeeRate;
19-
use bitcoin::ScriptBuf;
20+
use bitcoin::taproot::TapNodeHash;
2021
use bitcoin::{
21-
absolute, script::PushBytesBuf, taproot::TapNodeHash, Address, OutPoint, Sequence, Transaction,
22-
TxIn, TxOut, Weight,
22+
Address, Amount, BlockHash, FeeRate, Network, OutPoint, ScriptBuf, Sequence, Transaction, TxIn,
23+
TxOut, Txid, Weight,
2324
};
24-
use bitcoin::{psbt, Network};
25-
use bitcoin::{BlockHash, Txid};
2625
mod common;
2726
use common::*;
2827

0 commit comments

Comments
 (0)