Cli: Fix create-with-seed (#8706) (#8723)

automerge
This commit is contained in:
mergify[bot]
2020-03-09 00:16:29 -07:00
committed by GitHub
parent bb563b4835
commit dd54369e1b
3 changed files with 71 additions and 10 deletions

View File

@@ -110,6 +110,18 @@ pub fn signer_from_path(
}
}
pub fn pubkey_from_path(
matches: &ArgMatches,
path: &str,
keypair_name: &str,
wallet_manager: Option<&Arc<RemoteWalletManager>>,
) -> Result<Pubkey, Box<dyn error::Error>> {
match parse_keypair_path(path) {
KeypairUrl::Pubkey(pubkey) => Ok(pubkey),
_ => Ok(signer_from_path(matches, path, keypair_name, wallet_manager)?.pubkey()),
}
}
// Keyword used to indicate that the user should be asked for a keypair seed phrase
pub const ASK_KEYWORD: &str = "ASK";