'Awaiting finalization' status and changes to 'wallet check' (#8)

* add awaiting confirmation status and change check to not remove unconfirmed transactions by default

* test fixes
This commit is contained in:
Yeastplume
2019-03-07 16:19:47 +00:00
committed by GitHub
parent 6d92a67730
commit ddd9bc2908
12 changed files with 84 additions and 51 deletions
+11 -1
View File
@@ -452,6 +452,13 @@ pub fn parse_info_args(args: &ArgMatches) -> Result<command::InfoArgs, ParseErro
})
}
pub fn parse_check_args(args: &ArgMatches) -> Result<command::CheckArgs, ParseError> {
let delete_unconfirmed = args.is_present("delete_unconfirmed");
Ok(command::CheckArgs {
delete_unconfirmed: delete_unconfirmed,
})
}
pub fn parse_txs_args(args: &ArgMatches) -> Result<command::TxsArgs, ParseError> {
let tx_id = match args.value_of("id") {
None => None,
@@ -621,7 +628,10 @@ pub fn wallet_command(
command::cancel(inst_wallet(), a)
}
("restore", Some(_)) => command::restore(inst_wallet()),
("check", Some(_)) => command::check_repair(inst_wallet()),
("check", Some(args)) => {
let a = arg_parse!(parse_check_args(&args));
command::check_repair(inst_wallet(), a)
}
_ => {
let msg = format!("Unknown wallet command, use 'grin help wallet' for details");
return Err(ErrorKind::ArgumentError(msg).into());
+1 -1
View File
@@ -456,7 +456,7 @@ mod wallet_tests {
];
execute_command(&app, test_dir, "wallet1", &client1, arg_vec)?;
let arg_vec = vec!["grin-wallet", "-p", "password", "check"];
let arg_vec = vec!["grin-wallet", "-p", "password", "check", "-d"];
execute_command(&app, test_dir, "wallet1", &client1, arg_vec)?;
// Another file exchange, cancel this time
+6
View File
@@ -236,3 +236,9 @@ subcommands:
about: Restores a wallet contents from a seed file
- check:
about: Checks a wallet's outputs against a live node, repairing and restoring missing outputs if required
args:
- delete_unconfirmed:
help: Delete any unconfirmed outputsm unlock any locked outputs and delete associated transactions while doing the check.
short: d
long: delete_unconfirmed
takes_value: false