Add solana-close-vote-account to CLI (#19756)

This commit is contained in:
Drew Taylor
2021-09-13 08:13:59 -07:00
committed by GitHub
parent 4e7a100705
commit 2a29072019
4 changed files with 211 additions and 3 deletions

View File

@@ -308,6 +308,12 @@ pub enum CliCommand {
withdraw_amount: SpendAmount,
memo: Option<String>,
},
CloseVoteAccount {
vote_account_pubkey: Pubkey,
destination_account_pubkey: Pubkey,
withdraw_authority: SignerIndex,
memo: Option<String>,
},
VoteAuthorize {
vote_account_pubkey: Pubkey,
new_authorized_pubkey: Pubkey,
@@ -810,6 +816,9 @@ pub fn parse_command(
("withdraw-from-vote-account", Some(matches)) => {
parse_withdraw_from_vote_account(matches, default_signer, wallet_manager)
}
("close-vote-account", Some(matches)) => {
parse_close_vote_account(matches, default_signer, wallet_manager)
}
// Wallet Commands
("account", Some(matches)) => parse_account(matches, wallet_manager),
("address", Some(matches)) => Ok(CliCommandInfo {
@@ -1409,6 +1418,19 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
destination_account_pubkey,
memo.as_ref(),
),
CliCommand::CloseVoteAccount {
vote_account_pubkey,
withdraw_authority,
destination_account_pubkey,
memo,
} => process_close_vote_account(
&rpc_client,
config,
vote_account_pubkey,
*withdraw_authority,
destination_account_pubkey,
memo.as_ref(),
),
CliCommand::VoteAuthorize {
vote_account_pubkey,
new_authorized_pubkey,