Optional memo

This commit is contained in:
Aditya Kulkarni 2019-09-10 14:23:52 -07:00
parent 9c8389f8f0
commit 8cfa4401c0

View File

@ -92,7 +92,7 @@ impl Command for SendCommand {
fn exec(&self, args: &[&str], lightclient: &mut LightClient) {
// Parse the args.
// 1 - Destination address. T or Z address
if args.len() != 3 {
if args.len() < 2 || args.len() > 3 {
self.help();
return;
}
@ -105,8 +105,10 @@ impl Command for SendCommand {
return;
}
};
let memo = if args.len() == 3 { Some(args[2].to_string()) } else {None};
lightclient.do_send(args[0], value, Some(args[2].to_string()));
lightclient.do_send(args[0], value, memo);
}
}