diff --git a/rust-lightclient/src/commands.rs b/rust-lightclient/src/commands.rs index 885ea43..12775b3 100644 --- a/rust-lightclient/src/commands.rs +++ b/rust-lightclient/src/commands.rs @@ -90,7 +90,7 @@ impl Command for SendCommand { fn exec(&self, _args: &[String], lightclient: &mut LightClient) { lightclient.do_send( "ztestsapling1x65nq4dgp0qfywgxcwk9n0fvm4fysmapgr2q00p85ju252h6l7mmxu2jg9cqqhtvzd69jwhgv8d".to_string(), - 1500000, + 150000, Some("Hello from the command".to_string())); } } @@ -123,7 +123,7 @@ impl Command for SeedCommand { fn exec(&self, _args: &[String], lightclient: &mut LightClient) { let phrase = lightclient.do_seed_phrase(); - println!("Current seed phrase. PLEASE SAVE THIS CAREFULLY AND DO NOT SHARE IT"); + println!("PLEASE SAVE YOUR SEED PHRASE CAREFULLY AND DO NOT SHARE IT"); println!(); println!("{}", phrase); println!(); diff --git a/rust-lightclient/src/lightclient.rs b/rust-lightclient/src/lightclient.rs index 2670309..261db1d 100644 --- a/rust-lightclient/src/lightclient.rs +++ b/rust-lightclient/src/lightclient.rs @@ -39,8 +39,8 @@ pub struct LightClient { } impl LightClient { - pub fn new(seed_phrase: Option<&str>) -> io::Result { + pub fn new(seed_phrase: Option<&str>) -> io::Result { let mut lc = if Path::new("wallet.dat").exists() { // Make sure that if a wallet exists, there is no seed phrase being attempted if !seed_phrase.is_none() { @@ -58,7 +58,7 @@ impl LightClient { } } else { let l = LightClient { - wallet : Arc::new(LightWallet::new(seed_phrase).unwrap()), + wallet : Arc::new(LightWallet::new(seed_phrase)?), sapling_output : vec![], sapling_spend : vec![] }; @@ -287,23 +287,6 @@ impl LightClient { light_wallet_clone.scan_full_tx(&tx); }); }; - - // // Print all the memos for fun. - // let memos = self.wallet.txs.read().unwrap() - // .values().flat_map(|wtx| { - // wtx.notes.iter().map(|nd| nd.memo.clone() ).collect::>>() - // }) - // .map( |m| match m { - // Some(memo) => { - // match memo.to_utf8() { - // Some(Ok(memo_str)) => Some(memo_str), - // _ => None - // } - // } - // _ => None - // }) - // .collect::>>(); - //println!("All Wallet Txns {:?}", memos); } pub fn do_send(&self, addr: String, value: u64, memo: Option) { diff --git a/rust-lightclient/src/lightwallet.rs b/rust-lightclient/src/lightwallet.rs index 4b6d001..10ed676 100644 --- a/rust-lightclient/src/lightwallet.rs +++ b/rust-lightclient/src/lightwallet.rs @@ -879,7 +879,8 @@ impl LightWallet { println!("{}: Adding output", now() - start_time); if let Err(e) = match to { address::RecipientAddress::Shielded(to) => { - builder.add_sapling_output(ovk, to.clone(), value, encoded_memo) + // TODO Make it use encoded_memo + builder.add_sapling_output(ovk, to.clone(), value, None) } address::RecipientAddress::Transparent(to) => { builder.add_transparent_output(&to, value)