Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit cc309b7

Browse files
authored
test: ensure confidential_transfer using the latest blockhash (#6836)
test: ensure using the latest blockhash to process tx
1 parent ed85818 commit cc309b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

token/program-2022-test/tests/confidential_transfer_fee.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,11 +867,12 @@ async fn confidential_transfer_withdraw_withheld_tokens_from_mint_with_proof_con
867867
instruction_type.encode_verify_proof(Some(context_state_info), &proof_data),
868868
];
869869

870+
let recent_blockhash = ctx.get_new_latest_blockhash().await.unwrap();
870871
let tx = Transaction::new_signed_with_payer(
871872
&instructions,
872873
Some(&ctx.payer.pubkey()),
873874
&[&ctx.payer, &context_state_account],
874-
ctx.last_blockhash,
875+
recent_blockhash,
875876
);
876877
ctx.banks_client.process_transaction(tx).await.unwrap();
877878
}
@@ -1034,11 +1035,12 @@ async fn confidential_transfer_withdraw_withheld_tokens_from_accounts_with_proof
10341035
instruction_type.encode_verify_proof(Some(context_state_info), &proof_data),
10351036
];
10361037

1038+
let recent_blockhash = ctx.get_new_latest_blockhash().await.unwrap();
10371039
let tx = Transaction::new_signed_with_payer(
10381040
&instructions,
10391041
Some(&ctx.payer.pubkey()),
10401042
&[&ctx.payer, &context_state_account],
1041-
ctx.last_blockhash,
1043+
recent_blockhash,
10421044
);
10431045
ctx.banks_client.process_transaction(tx).await.unwrap();
10441046
}

0 commit comments

Comments
 (0)