Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
test: ensure confidential_transfer using the latest blockhash (#6836)
Browse files Browse the repository at this point in the history
test: ensure using the latest blockhash to process tx
  • Loading branch information
yihau authored Jun 12, 2024
1 parent ed85818 commit cc309b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions token/program-2022-test/tests/confidential_transfer_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,12 @@ async fn confidential_transfer_withdraw_withheld_tokens_from_mint_with_proof_con
instruction_type.encode_verify_proof(Some(context_state_info), &proof_data),
];

let recent_blockhash = ctx.get_new_latest_blockhash().await.unwrap();
let tx = Transaction::new_signed_with_payer(
&instructions,
Some(&ctx.payer.pubkey()),
&[&ctx.payer, &context_state_account],
ctx.last_blockhash,
recent_blockhash,
);
ctx.banks_client.process_transaction(tx).await.unwrap();
}
Expand Down Expand Up @@ -1034,11 +1035,12 @@ async fn confidential_transfer_withdraw_withheld_tokens_from_accounts_with_proof
instruction_type.encode_verify_proof(Some(context_state_info), &proof_data),
];

let recent_blockhash = ctx.get_new_latest_blockhash().await.unwrap();
let tx = Transaction::new_signed_with_payer(
&instructions,
Some(&ctx.payer.pubkey()),
&[&ctx.payer, &context_state_account],
ctx.last_blockhash,
recent_blockhash,
);
ctx.banks_client.process_transaction(tx).await.unwrap();
}
Expand Down

0 comments on commit cc309b7

Please sign in to comment.