Cli: Add resolve-signer subcommand (#8859)
* Expose remote-wallet device pretty path * Add resolve-signer helpers * Add cli resolve-signer subcommand * Print pretty-path in waiting msg
This commit is contained in:
@@ -55,6 +55,7 @@ mod commands {
|
||||
/// Ledger Wallet device
|
||||
pub struct LedgerWallet {
|
||||
pub device: hidapi::HidDevice,
|
||||
pub pretty_path: String,
|
||||
}
|
||||
|
||||
impl fmt::Debug for LedgerWallet {
|
||||
@@ -65,7 +66,10 @@ impl fmt::Debug for LedgerWallet {
|
||||
|
||||
impl LedgerWallet {
|
||||
pub fn new(device: hidapi::HidDevice) -> Self {
|
||||
Self { device }
|
||||
Self {
|
||||
device,
|
||||
pretty_path: String::default(),
|
||||
}
|
||||
}
|
||||
|
||||
// Transport Protocol:
|
||||
@@ -231,7 +235,10 @@ impl LedgerWallet {
|
||||
) -> Result<Vec<u8>, RemoteWalletError> {
|
||||
self.write(command, p1, p2, data)?;
|
||||
if p1 == P1_CONFIRM && is_last_part(p2) {
|
||||
println!("Waiting for remote wallet to approve...");
|
||||
println!(
|
||||
"Waiting for approval from remote wallet {}",
|
||||
self.pretty_path
|
||||
);
|
||||
let result = self.read()?;
|
||||
println!("{}Approved", CHECK_MARK);
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user