Skip to content

Commit a2f5954

Browse files
Clean up commands.rs and handlers.rs per review comments
1 parent 7931dbd commit a2f5954

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/commands.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
//! All optional args are defined in the structs below.
1313
//! All subcommands are defined in the below enums.
1414
15-
16-
#[allow(clippy::large_enum_variant)]
17-
15+
#![allow(clippy::large_enum_variant)]
1816
use bdk_wallet::bitcoin::{
1917
Address, Network, OutPoint, ScriptBuf,
2018
bip32::{DerivationPath, Xpriv},
@@ -401,7 +399,7 @@ pub enum OnlineWalletSubCommand {
401399
stop_gap: usize,
402400
},
403401
/// Syncs with the chosen blockchain server.
404-
Sync {
402+
Sync {
405403
#[command(flatten)]
406404
wallet_opts: WalletOpts,
407405
},

src/handlers.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
//! Command Handlers
1010
//!
1111
//! This module describes all the command handling logic used by bdk-cli.
12-
use crate::debug;
1312
use crate::commands::OfflineWalletSubCommand::*;
1413
use crate::commands::*;
1514
use crate::error::BDKCliError as Error;
@@ -619,7 +618,11 @@ pub(crate) async fn handle_online_wallet_subcommand(
619618
});
620619
match client {
621620
#[cfg(feature = "electrum")]
622-
Electrum { client, batch_size,validate_domain } => {
621+
Electrum {
622+
client,
623+
batch_size,
624+
validate_domain: _,
625+
} => {
623626
// Populate the electrum client's transaction cache so it doesn't re-download transaction we
624627
// already have.
625628
client
@@ -686,7 +689,7 @@ pub(crate) async fn handle_online_wallet_subcommand(
686689
}
687690
Ok(serde_json::to_string_pretty(&json!({}))?)
688691
}
689-
Sync => {
692+
sync => {
690693
#[cfg(any(feature = "electrum", feature = "esplora"))]
691694
let request = wallet
692695
.start_sync_with_revealed_spks()
@@ -697,13 +700,17 @@ pub(crate) async fn handle_online_wallet_subcommand(
697700

698701
match client {
699702
#[cfg(feature = "electrum")]
700-
Electrum { client, batch_size, validate_domain } => {
703+
Electrum {
704+
client,
705+
batch_size,
706+
validate_domain,
707+
} => {
701708
// Populate the electrum client's transaction cache so it doesn't re-download transaction we
702709
// already have.
703710
client
704711
.populate_tx_cache(wallet.tx_graph().full_txs().map(|tx_node| tx_node.tx));
705712

706-
let update = client.sync(request, batch_size, validate_domain)?;
713+
let update = client.sync(request, batch_size, false)?;
707714
wallet.apply_update(update)?;
708715
}
709716
#[cfg(feature = "esplora")]

0 commit comments

Comments
 (0)