Skip to content

Commit 9bdf4cb

Browse files
committed
chore: fix imports
1 parent 28d8061 commit 9bdf4cb

File tree

2 files changed

+38
-44
lines changed

2 files changed

+38
-44
lines changed

crates/wallet/src/wallet/mod.rs

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@
1212
//! Wallet
1313
//!
1414
//! This module defines the [`Wallet`].
15-
use crate::{
16-
collections::{BTreeMap, HashMap},
17-
descriptor::check_wallet_descriptor,
18-
};
15+
1916
use alloc::{
2017
boxed::Box,
2118
string::{String, ToString},
2219
sync::Arc,
2320
vec::Vec,
2421
};
25-
pub use bdk_chain::Balance;
22+
use core::{cmp::Ordering, fmt, mem, ops::Deref};
23+
2624
use bdk_chain::{
2725
indexed_tx_graph,
2826
indexer::keychain_txout::KeychainTxOutIndex,
@@ -33,63 +31,62 @@ use bdk_chain::{
3331
FullScanRequest, FullScanRequestBuilder, FullScanResult, SyncRequest, SyncRequestBuilder,
3432
SyncResult,
3533
},
36-
tx_graph::{CanonicalTx, TxGraph, TxNode, TxUpdate},
34+
tx_graph::{CalculateFeeError, CanonicalTx, TxGraph, TxNode, TxUpdate},
3735
BlockId, ChainPosition, ConfirmationBlockTime, DescriptorExt, FullTxOut, Indexed,
3836
IndexedTxGraph, Merge,
3937
};
40-
use bitcoin::sighash::{EcdsaSighashType, TapSighashType};
4138
use bitcoin::{
42-
absolute, psbt, Address, Block, FeeRate, Network, OutPoint, ScriptBuf, Sequence, Transaction,
43-
TxOut, Txid, Witness,
39+
absolute,
40+
consensus::encode::serialize,
41+
constants::genesis_block,
42+
psbt,
43+
secp256k1::Secp256k1,
44+
sighash::{EcdsaSighashType, TapSighashType},
45+
transaction, Address, Amount, Block, BlockHash, FeeRate, Network, OutPoint, Psbt, ScriptBuf,
46+
Sequence, Transaction, TxOut, Txid, Weight, Witness,
4447
};
45-
use bitcoin::{consensus::encode::serialize, transaction, BlockHash, Psbt};
46-
use bitcoin::{constants::genesis_block, Amount};
47-
use bitcoin::{secp256k1::Secp256k1, Weight};
48-
use core::cmp::Ordering;
49-
use core::fmt;
50-
use core::mem;
51-
use core::ops::Deref;
52-
use rand_core::RngCore;
53-
54-
use descriptor::error::Error as DescriptorError;
5548
use miniscript::{
5649
descriptor::KeyMap,
5750
psbt::{PsbtExt, PsbtInputExt, PsbtInputSatisfier},
5851
};
59-
60-
use bdk_chain::tx_graph::CalculateFeeError;
52+
use rand_core::RngCore;
6153

6254
mod changeset;
6355
pub mod coin_selection;
56+
pub mod error;
6457
pub mod export;
6558
mod params;
59+
mod persisted;
6660
pub mod signer;
6761
pub mod tx_builder;
68-
pub use changeset::*;
69-
pub use params::*;
70-
mod persisted;
71-
pub use persisted::*;
7262
pub(crate) mod utils;
7363

74-
pub mod error;
75-
76-
pub use utils::IsDust;
77-
78-
use coin_selection::{DefaultCoinSelectionAlgorithm, InsufficientFunds};
79-
use signer::{SignOptions, SignerOrdering, SignersContainer, TransactionSigner};
80-
use tx_builder::{FeePolicy, TxBuilder, TxParams};
81-
use utils::{check_nsequence_rbf, After, Older, SecpCtx};
82-
83-
use crate::descriptor::policy::BuildSatisfaction;
64+
use crate::collections::{BTreeMap, HashMap};
8465
use crate::descriptor::{
85-
self, DerivedDescriptor, DescriptorMeta, ExtendedDescriptor, ExtractPolicy,
86-
IntoWalletDescriptor, Policy, XKeyUtils,
66+
check_wallet_descriptor, error::Error as DescriptorError, policy::BuildSatisfaction,
67+
DerivedDescriptor, DescriptorMeta, ExtendedDescriptor, ExtractPolicy, IntoWalletDescriptor,
68+
Policy, XKeyUtils,
8769
};
8870
use crate::psbt::PsbtUtils;
89-
use crate::signer::SignerError;
9071
use crate::types::*;
91-
use crate::wallet::coin_selection::Excess::{self, Change, NoChange};
92-
use crate::wallet::error::{BuildFeeBumpError, CreateTxError, MiniscriptPsbtError};
72+
use crate::wallet::{
73+
coin_selection::{
74+
DefaultCoinSelectionAlgorithm,
75+
Excess::{self, Change, NoChange},
76+
InsufficientFunds,
77+
},
78+
error::{BuildFeeBumpError, CreateTxError, MiniscriptPsbtError},
79+
signer::{SignOptions, SignerError, SignerOrdering, SignersContainer, TransactionSigner},
80+
tx_builder::{FeePolicy, TxBuilder, TxParams},
81+
utils::{check_nsequence_rbf, After, Older, SecpCtx},
82+
};
83+
84+
// re-exports
85+
pub use bdk_chain::Balance;
86+
pub use changeset::ChangeSet;
87+
pub use params::*;
88+
pub use persisted::*;
89+
pub use utils::IsDust;
9390

9491
const COINBASE_MATURITY: u32 = 100;
9592

crates/wallet/tests/wallet.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
extern crate alloc;
2-
31
use std::path::Path;
42
use std::str::FromStr;
3+
use std::sync::Arc;
54

65
use anyhow::Context;
76
use assert_matches::assert_matches;
@@ -925,8 +924,6 @@ fn test_create_tx_drain_to_dust_amount() {
925924

926925
#[test]
927926
fn test_create_tx_ordering_respected() {
928-
use alloc::sync::Arc;
929-
930927
let (mut wallet, _) = get_funded_wallet_wpkh();
931928
let addr = wallet.next_unused_address(KeychainKind::External);
932929

0 commit comments

Comments
 (0)