mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 15:21:39 +02:00
'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:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user