Skip to content

Commit

Permalink
Update handle offline fn and repl to work with online wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
notmandatory committed Feb 9, 2021
1 parent 3211af0 commit 9fb50b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/bdk_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

use std::fs;
use std::path::PathBuf;
use std::sync::Arc;

use bitcoin::Network;
use clap::AppSettings;
Expand Down Expand Up @@ -186,10 +185,6 @@ fn main() {
CliSubCommand::Repl { wallet_opts } => {
let database = open_database(&wallet_opts);
let online_wallet = new_online_wallet(network, &wallet_opts, database.clone()).unwrap();
let online_wallet = Arc::new(online_wallet);

let offline_wallet = new_offline_wallet(network, &wallet_opts, database).unwrap();
let offline_wallet = Arc::new(offline_wallet);

let mut rl = Editor::<()>::new();

Expand Down Expand Up @@ -231,13 +226,13 @@ fn main() {
let result = match repl_subcommand {
ReplSubCommand::OnlineWalletSubCommand(online_subcommand) => {
bdk_cli::handle_online_wallet_subcommand(
&Arc::clone(&online_wallet),
&online_wallet,
online_subcommand,
)
}
ReplSubCommand::OfflineWalletSubCommand(offline_subcommand) => {
bdk_cli::handle_offline_wallet_subcommand(
&Arc::clone(&offline_wallet),
&online_wallet,
offline_subcommand,
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ fn parse_outpoint(s: &str) -> Result<OutPoint, String> {
///
/// Offline wallet sub-commands are described in [`OfflineWalletSubCommand`].
#[maybe_async]
pub fn handle_offline_wallet_subcommand<D>(
wallet: &Wallet<(), D>,
pub fn handle_offline_wallet_subcommand<T, D>(
wallet: &Wallet<T, D>,
offline_subcommand: OfflineWalletSubCommand,
) -> Result<serde_json::Value, Error>
where
Expand Down

0 comments on commit 9fb50b1

Please sign in to comment.