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

@ -147,7 +147,8 @@ fn test_vote_authorize_and_withdraw() {
memo: None,
};
process_command(&config).unwrap();
check_recent_balance(expected_balance - 100, &rpc_client, &vote_account_pubkey);
let expected_balance = expected_balance - 100;
check_recent_balance(expected_balance, &rpc_client, &vote_account_pubkey);
check_recent_balance(100, &rpc_client, &destination_account);
// Re-assign validator identity
@ -160,4 +161,17 @@ fn test_vote_authorize_and_withdraw() {
memo: None,
};
process_command(&config).unwrap();
// Close vote account
let destination_account = solana_sdk::pubkey::new_rand(); // Send withdrawal to new account to make balance check easy
config.signers = vec![&default_signer, &withdraw_authority];
config.command = CliCommand::CloseVoteAccount {
vote_account_pubkey,
withdraw_authority: 1,
destination_account_pubkey: destination_account,
memo: None,
};
process_command(&config).unwrap();
check_recent_balance(0, &rpc_client, &vote_account_pubkey);
check_recent_balance(expected_balance, &rpc_client, &destination_account);
}