Skip to content

Commit

Permalink
VAULT: CLI hotfix (#162)
Browse files Browse the repository at this point in the history
Added in missing account to the CLI command `burn_withdrawal_ticket`
  • Loading branch information
coachchucksol authored Dec 16, 2024
1 parent a4e04d3 commit 272de67
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cli/src/vault_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,22 @@ impl VaultCliHandler {
let vault_staker_withdrawal_ticket_token_account =
get_associated_token_address(&vault_staker_withdrawal_ticket, &vault_account.vrt_mint);

let config = Config::find_program_address(&self.vault_program_id).0;
let config_account_raw = rpc_client.get_account(&config).await?;
let config_account = Config::try_from_slice_unchecked(&config_account_raw.data)?;

let program_fee_ata = create_associated_token_account_idempotent(
&keypair.pubkey(),
&config_account.program_fee_wallet,
&vault_account.vrt_mint,
&spl_token::ID,
);

let program_fee_token_account = get_associated_token_address(
&config_account.program_fee_wallet,
&vault_account.vrt_mint,
);

let mut ix_builder = BurnWithdrawalTicketBuilder::new();
ix_builder
.config(Config::find_program_address(&self.vault_program_id).0)
Expand All @@ -902,14 +918,15 @@ impl VaultCliHandler {
.vault_staker_withdrawal_ticket_token_account(
vault_staker_withdrawal_ticket_token_account,
)
.program_fee_token_account(program_fee_token_account)
.staker_token_account(staker_token_account)
.vault_fee_token_account(vault_fee_token_account)
.vault_token_account(vault_token_account)
.staker(staker);

let blockhash = rpc_client.get_latest_blockhash().await?;
let tx = Transaction::new_signed_with_payer(
&[ix_builder.instruction()],
&[program_fee_ata, ix_builder.instruction()],
Some(&keypair.pubkey()),
&[keypair],
blockhash,
Expand Down

0 comments on commit 272de67

Please sign in to comment.