spl-token-cli: Use CLI config wallet for nonce authority fallback

This commit is contained in:
Trent Nelson 2021-04-01 00:44:47 -06:00 committed by Trent Nelson
parent 25a6a6e923
commit 84f2f33f49
1 changed files with 17 additions and 10 deletions

View File

@ -1954,16 +1954,23 @@ fn main() {
eprintln!("error: {}", e); eprintln!("error: {}", e);
exit(1); exit(1);
}); });
let (signer, nonce_authority) = let (signer, nonce_authority) = signer_from_path(
signer_of(&matches, NONCE_AUTHORITY_ARG.name, &mut wallet_manager).unwrap_or_else( &matches,
|e| { matches
eprintln!("error: {}", e); .value_of(NONCE_AUTHORITY_ARG.name)
exit(1); .unwrap_or(&cli_config.keypair_path),
}, NONCE_AUTHORITY_ARG.name,
); &mut wallet_manager,
if signer.is_some() { )
bulk_signers.push(signer); .map(|s| {
} let p = s.pubkey();
(Some(s), Some(p))
})
.unwrap_or_else(|e| {
eprintln!("error: {}", e);
exit(1);
});
bulk_signers.push(signer);
let blockhash_query = BlockhashQuery::new_from_matches(matches); let blockhash_query = BlockhashQuery::new_from_matches(matches);
let sign_only = matches.is_present(SIGN_ONLY_ARG.name); let sign_only = matches.is_present(SIGN_ONLY_ARG.name);