Pass cli tests, remove compiler warnings

This commit is contained in:
Kristoffer Ström
2016-09-29 14:48:44 +02:00
committed by arkpar
parent 4e3f8bab10
commit 273d7c00c3
5 changed files with 11 additions and 13 deletions

View File

@@ -16,10 +16,9 @@ use std::fs::File;
use futures::Future;
fn sign_interactive(signer: &mut SignerRpc, pwd: &String, request: ConfirmationRequest)
-> Result<String, String>
{
print!("\n{}\nSign this transaction? (y)es/(N)o/(r)eject: ", request);
stdout().flush();
let _ = stdout().flush();
match BufReader::new(stdin()).lines().next() {
Some(Ok(line)) => {
match line.to_lowercase().chars().nth(0) {
@@ -36,9 +35,8 @@ fn sign_interactive(signer: &mut SignerRpc, pwd: &String, request: ConfirmationR
_ => ()
}
}
_ => return Err("Could not read from stdin".to_string())
_ => println!("Could not read from stdin")
}
Ok("Finished".to_string())
}
fn sign_transactions(signer: &mut SignerRpc, pwd: String) -> Result<String, String> {
@@ -49,7 +47,7 @@ fn sign_transactions(signer: &mut SignerRpc, pwd: String) -> Result<String, Stri
Ok("No transactions in signing queue".to_string())
} else {
for r in reqs {
sign_interactive(signer, &pwd, r);
sign_interactive(signer, &pwd, r)
}
Ok("".to_string())
}