CLI: Fix create-nonce-account
with seed (#8929)
* CLI: Fix `create-nonce-account --seed ...` * CLI: Add test another for `create-nonce-account --seed...` Explicitly demonstrates a partner workflow with the following requirements: 1) Nonce account address derived from an offline nonce authority address 2) Fully online account creation 3) Account creation in a single signing session * alphabetize
This commit is contained in:
@ -41,6 +41,7 @@ use solana_sdk::{
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signature, Signer, SignerError},
|
||||
system_instruction::{self, create_address_with_seed, SystemError, MAX_ADDRESS_SEED_LEN},
|
||||
system_program,
|
||||
transaction::{Transaction, TransactionError},
|
||||
};
|
||||
use solana_stake_program::{
|
||||
@ -1066,9 +1067,10 @@ pub fn parse_create_address_with_seed(
|
||||
};
|
||||
|
||||
let program_id = match matches.value_of("program_id").unwrap() {
|
||||
"NONCE" => system_program::id(),
|
||||
"STAKE" => solana_stake_program::id(),
|
||||
"VOTE" => solana_vote_program::id(),
|
||||
"STORAGE" => solana_storage_program::id(),
|
||||
"VOTE" => solana_vote_program::id(),
|
||||
_ => pubkey_of(matches, "program_id").unwrap(),
|
||||
};
|
||||
|
||||
@ -2345,7 +2347,7 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
|
||||
.required(true)
|
||||
.help(
|
||||
"The program_id that the address will ultimately be used for, \n\
|
||||
or one of STAKE, VOTE, and STORAGE keywords",
|
||||
or one of NONCE, STAKE, STORAGE, and VOTE keywords",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
@ -2767,6 +2769,7 @@ mod tests {
|
||||
("STAKE", solana_stake_program::id()),
|
||||
("VOTE", solana_vote_program::id()),
|
||||
("STORAGE", solana_storage_program::id()),
|
||||
("NONCE", system_program::id()),
|
||||
] {
|
||||
let test_create_address_with_seed = test_commands.clone().get_matches_from(vec![
|
||||
"test",
|
||||
|
Reference in New Issue
Block a user