Skip to content

Commit 31f256a

Browse files
committed
Arranged imports to make it better and easier for reviewers to track changes
1 parent efdbb5e commit 31f256a

File tree

2 files changed

+21
-32
lines changed

2 files changed

+21
-32
lines changed

src/handlers.rs

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,9 @@ use bdk_wallet::bitcoin::consensus::encode::serialize_hex;
2222
use bdk_wallet::bitcoin::script::PushBytesBuf;
2323
use bdk_wallet::bitcoin::Network;
2424
use bdk_wallet::bitcoin::{secp256k1::Secp256k1, Txid};
25+
use bdk_wallet::bitcoin::{Amount, FeeRate, Psbt, Sequence};
2526
use bdk_wallet::descriptor::Segwitv0;
2627
use bdk_wallet::keys::bip39::WordCount;
27-
use bdk_wallet::keys::{GeneratableKey, GeneratedKey};
28-
use bdk_wallet::serde::ser::Error as SerdeErrorTrait;
29-
use serde_json::json;
30-
use serde_json::Error as SerdeError;
31-
use serde_json::Value;
32-
33-
#[cfg(any(
34-
feature = "electrum",
35-
feature = "esplora",
36-
feature = "cbf",
37-
feature = "rpc"
38-
))]
39-
use bdk_wallet::bitcoin::Transaction;
40-
use bdk_wallet::bitcoin::{Amount, FeeRate, Psbt, Sequence};
4128
#[cfg(feature = "sqlite")]
4229
use bdk_wallet::rusqlite::Connection;
4330
#[cfg(feature = "compiler")]
@@ -46,24 +33,27 @@ use bdk_wallet::{
4633
miniscript::policy::Concrete,
4734
};
4835
use bdk_wallet::{KeychainKind, SignOptions, Wallet};
49-
use std::fmt;
50-
use std::str::FromStr;
5136

37+
#[cfg(feature = "electrum")]
38+
use crate::utils::BlockchainClient::Electrum;
39+
#[cfg(feature = "cbf")]
40+
use bdk_kyoto::{Info, LightClient};
41+
use bdk_wallet::bitcoin::base64::prelude::*;
5242
use bdk_wallet::keys::DescriptorKey::Secret;
53-
use bdk_wallet::keys::{DerivableKey, DescriptorKey, ExtendedKey};
43+
use bdk_wallet::keys::{DerivableKey, DescriptorKey, ExtendedKey, GeneratableKey, GeneratedKey};
5444
use bdk_wallet::miniscript::miniscript;
45+
use bdk_wallet::serde::ser::Error as SerdeErrorTrait;
46+
use serde_json::json;
47+
use serde_json::Error as SerdeError;
48+
use serde_json::Value;
5549
use std::collections::BTreeMap;
5650
#[cfg(any(feature = "electrum", feature = "esplora"))]
5751
use std::collections::HashSet;
5852
use std::convert::TryFrom;
53+
use std::fmt;
5954
#[cfg(any(feature = "repl", feature = "electrum", feature = "esplora"))]
6055
use std::io::Write;
61-
62-
#[cfg(feature = "electrum")]
63-
use crate::utils::BlockchainClient::Electrum;
64-
#[cfg(feature = "cbf")]
65-
use bdk_kyoto::{Info, LightClient};
66-
use bdk_wallet::bitcoin::base64::prelude::*;
56+
use std::str::FromStr;
6757
#[cfg(feature = "cbf")]
6858
use tokio::select;
6959
#[cfg(any(
@@ -74,7 +64,7 @@ use tokio::select;
7464
))]
7565
use {
7666
crate::commands::OnlineWalletSubCommand::*,
77-
bdk_wallet::bitcoin::{consensus::Decodable, hex::FromHex},
67+
bdk_wallet::bitcoin::{consensus::Decodable, hex::FromHex, Transaction},
7868
};
7969
#[cfg(feature = "esplora")]
8070
use {crate::utils::BlockchainClient::Esplora, bdk_esplora::EsploraAsyncExt};

src/utils.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,24 @@
1010
//!
1111
//! This module includes all the utility tools used by the App.
1212
use crate::error::BDKCliError as Error;
13+
use std::str::FromStr;
14+
15+
use std::path::{Path, PathBuf};
16+
1317
use bdk_wallet::bip39::{Language, Mnemonic};
1418
use bdk_wallet::bitcoin::bip32::DerivationPath;
1519
use bdk_wallet::bitcoin::bip32::{Xpriv, Xpub};
1620
use bdk_wallet::bitcoin::secp256k1::Secp256k1;
1721
use bdk_wallet::descriptor::Segwitv0;
1822
use bdk_wallet::descriptor::{Descriptor, DescriptorPublicKey};
1923
use bdk_wallet::keys::bip39::WordCount;
24+
use bdk_wallet::keys::{DescriptorSecretKey, IntoDescriptorKey};
2025
use bdk_wallet::keys::{GeneratableKey, GeneratedKey};
26+
use bdk_wallet::miniscript::descriptor::{DescriptorXKey, Wildcard};
2127
use serde_json::json;
2228
use serde_json::Value;
2329

24-
use bdk_wallet::keys::{DescriptorSecretKey, IntoDescriptorKey};
25-
use bdk_wallet::miniscript::descriptor::{DescriptorXKey, Wildcard};
26-
27-
use std::str::FromStr;
28-
29-
use std::path::{Path, PathBuf};
30-
31-
use crate::commands::*;
30+
use crate::commands::WalletOpts;
3231
#[cfg(feature = "cbf")]
3332
use bdk_kyoto::{
3433
builder::NodeBuilder,

0 commit comments

Comments
 (0)