Skip to content

Commit

Permalink
close vaa too
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Sep 16, 2024
1 parent 7c0df82 commit 7f27ab5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions staking/cli/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,22 @@ pub fn write_encoded_vaa(
);
}

pub fn close_encoded_vaa(rpc_client: &RpcClient, payer: &Keypair, encoded_vaa: Pubkey) {
let close_encoded_vaa_accounts = wormhole_core_bridge_solana::accounts::CloseEncodedVaa {
write_authority: payer.pubkey(),
encoded_vaa,
}
.to_account_metas(None);

let close_encoded_vaa_instruction = Instruction {
program_id: wormhole_core_bridge_solana::ID,
accounts: close_encoded_vaa_accounts,
data: wormhole_core_bridge_solana::instruction::CloseEncodedVaa {}.data(),
};

process_transaction(rpc_client, &[close_encoded_vaa_instruction], &[payer]);
}

pub fn initialize_reward_custody(rpc_client: &RpcClient, payer: &Keypair) {
let pool_config = get_pool_config_address();

Expand Down Expand Up @@ -517,6 +533,7 @@ pub fn fetch_publisher_caps_and_advance(

advance(rpc_client, payer, publisher_caps);
close_publisher_caps(rpc_client, payer, publisher_caps);
close_encoded_vaa(rpc_client, payer, encoded_vaa);
}

pub fn update_delegation_fee(rpc_client: &RpcClient, payer: &Keypair, delegation_fee: u64) {
Expand Down

0 comments on commit 7f27ab5

Please sign in to comment.