From d1bf88bebad9ab36a93b8a2f60962a0828dc2192 Mon Sep 17 00:00:00 2001 From: vmammal Date: Thu, 16 Nov 2023 18:45:21 -0500 Subject: [PATCH] chore: organize some imports In particular, separate top-level bitcoin types from those nested in submodules --- crates/bdk/src/wallet/tx_builder.rs | 6 ++++-- crates/bdk/tests/wallet.rs | 13 ++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/crates/bdk/src/wallet/tx_builder.rs b/crates/bdk/src/wallet/tx_builder.rs index c7ffd8226f..7ea2a0ea02 100644 --- a/crates/bdk/src/wallet/tx_builder.rs +++ b/crates/bdk/src/wallet/tx_builder.rs @@ -48,15 +48,17 @@ use core::cell::RefCell; use core::fmt; use core::marker::PhantomData; +use bitcoin::absolute; use bitcoin::psbt::{self, PartiallySignedTransaction as Psbt}; -use bitcoin::{absolute, script::PushBytes, OutPoint, ScriptBuf, Sequence, Transaction, Txid}; +use bitcoin::script::PushBytes; +use bitcoin::{FeeRate, OutPoint, ScriptBuf, Sequence, Transaction, Txid}; use super::coin_selection::{CoinSelectionAlgorithm, DefaultCoinSelectionAlgorithm}; use super::ChangeSet; use crate::types::{KeychainKind, LocalUtxo, WeightedUtxo}; use crate::wallet::CreateTxError; use crate::{Utxo, Wallet}; -use bitcoin::FeeRate; + /// Context in which the [`TxBuilder`] is valid pub trait TxBuilderContext: core::fmt::Debug + Default + Clone {} diff --git a/crates/bdk/tests/wallet.rs b/crates/bdk/tests/wallet.rs index 6ff4397801..83d84c5a0d 100644 --- a/crates/bdk/tests/wallet.rs +++ b/crates/bdk/tests/wallet.rs @@ -12,17 +12,16 @@ use bdk::wallet::{AddressIndex, AddressInfo, Balance, Wallet}; use bdk::KeychainKind; use bdk_chain::COINBASE_MATURITY; use bdk_chain::{BlockId, ConfirmationTime}; +use bitcoin::absolute; use bitcoin::hashes::Hash; +use bitcoin::psbt; +use bitcoin::script::PushBytesBuf; use bitcoin::sighash::{EcdsaSighashType, TapSighashType}; -use bitcoin::Amount; -use bitcoin::FeeRate; -use bitcoin::ScriptBuf; +use bitcoin::taproot::TapNodeHash; use bitcoin::{ - absolute, script::PushBytesBuf, taproot::TapNodeHash, Address, OutPoint, Sequence, Transaction, - TxIn, TxOut, Weight, + Address, Amount, BlockHash, FeeRate, Network, OutPoint, ScriptBuf, Sequence, Transaction, TxIn, + TxOut, Txid, Weight, }; -use bitcoin::{psbt, Network}; -use bitcoin::{BlockHash, Txid}; mod common; use common::*;