cli: coerce with seed program id mnemonics to uppercase

This commit is contained in:
Trent Nelson 2022-02-11 15:30:40 -07:00 committed by Trent Nelson
parent 1719d2349f
commit dcd0a39cb6
1 changed files with 8 additions and 5 deletions

View File

@ -273,11 +273,14 @@ impl WalletSubCommands for App<'_, '_> {
}
fn resolve_derived_address_program_id(matches: &ArgMatches<'_>, arg_name: &str) -> Option<Pubkey> {
matches.value_of(arg_name).and_then(|v| match v {
"NONCE" => Some(system_program::id()),
"STAKE" => Some(stake::program::id()),
"VOTE" => Some(solana_vote_program::id()),
_ => pubkey_of(matches, arg_name),
matches.value_of(arg_name).and_then(|v| {
let upper = v.to_ascii_uppercase();
match upper.as_str() {
"NONCE" => Some(system_program::id()),
"STAKE" => Some(stake::program::id()),
"VOTE" => Some(solana_vote_program::id()),
_ => pubkey_of(matches, arg_name),
}
})
}