]> Untitled Git - bdk-cli/commitdiff
[wallet] Specify the policy branch with a map
authorAlekos Filini <alekos.filini@gmail.com>
Sat, 16 May 2020 14:48:31 +0000 (16:48 +0200)
committerAlekos Filini <alekos.filini@gmail.com>
Sat, 16 May 2020 14:48:31 +0000 (16:48 +0200)
src/cli.rs

index 9dc37a3206272dcbd511091a900ab9557dde4b4c..3dd23c044344562a1ce4d97fa693a8336c87f633 100644 (file)
@@ -1,3 +1,4 @@
+use std::collections::BTreeMap;
 use std::str::FromStr;
 
 use clap::{App, Arg, ArgMatches, SubCommand};
@@ -110,7 +111,7 @@ pub fn make_cli_subcommands<'a, 'b>() -> App<'a, 'b> {
                     Arg::with_name("policy")
                         .long("policy")
                         .value_name("POLICY")
-                        .help("Selects which policy will be used to satisfy the descriptor")
+                        .help("Selects which policy should be used to satisfy the descriptor")
                         .takes_value(true)
                         .number_of_values(1),
                 ),
@@ -252,9 +253,9 @@ where
         let unspendable = sub_matches
             .values_of("unspendable")
             .map(|s| s.map(|i| parse_outpoint(i).unwrap()).collect());
-        let policy: Option<Vec<_>> = sub_matches
+        let policy: Option<_> = sub_matches
             .value_of("policy")
-            .map(|s| serde_json::from_str::<Vec<Vec<usize>>>(&s).unwrap());
+            .map(|s| serde_json::from_str::<BTreeMap<String, Vec<usize>>>(&s).unwrap());
 
         let result = wallet.create_tx(
             addressees,