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

Commit fd92ccf

Browse files
authored
stake-pool: Keep trying to fix tests for CI (#3871)
1 parent 5664072 commit fd92ccf

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

stake-pool/program/tests/withdraw_edge_cases.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -751,21 +751,24 @@ async fn success_with_small_preferred_withdraw() {
751751
)
752752
.await;
753753

754+
let last_blockhash = context
755+
.banks_client
756+
.get_new_latest_blockhash(&context.last_blockhash)
757+
.await
758+
.unwrap();
759+
754760
// add a tiny bit of stake, less than lamports per pool token to preferred validator
755761
let rent = context.banks_client.get_rent().await.unwrap();
756762
let rent_exempt = rent.minimum_balance(std::mem::size_of::<stake::state::StakeState>());
757-
let stake_minimum_delegation = stake_get_minimum_delegation(
758-
&mut context.banks_client,
759-
&context.payer,
760-
&context.last_blockhash,
761-
)
762-
.await;
763+
let stake_minimum_delegation =
764+
stake_get_minimum_delegation(&mut context.banks_client, &context.payer, &last_blockhash)
765+
.await;
763766
let minimum_lamports = stake_minimum_delegation + rent_exempt;
764767

765768
simple_deposit_stake(
766769
&mut context.banks_client,
767770
&context.payer,
768-
&context.last_blockhash,
771+
&last_blockhash,
769772
&stake_pool_accounts,
770773
&preferred_validator,
771774
stake_minimum_delegation + 1, // stake_rent gets deposited too
@@ -778,7 +781,7 @@ async fn success_with_small_preferred_withdraw() {
778781
.decrease_validator_stake(
779782
&mut context.banks_client,
780783
&context.payer,
781-
&context.last_blockhash,
784+
&last_blockhash,
782785
&preferred_validator.stake_account,
783786
&preferred_validator.transient_stake_account,
784787
minimum_lamports,
@@ -799,7 +802,7 @@ async fn success_with_small_preferred_withdraw() {
799802
.update_all(
800803
&mut context.banks_client,
801804
&context.payer,
802-
&context.last_blockhash,
805+
&last_blockhash,
803806
&[
804807
validator_stake.vote.pubkey(),
805808
preferred_validator.vote.pubkey(),
@@ -814,7 +817,7 @@ async fn success_with_small_preferred_withdraw() {
814817
.withdraw_stake(
815818
&mut context.banks_client,
816819
&context.payer,
817-
&context.last_blockhash,
820+
&last_blockhash,
818821
&user_stake_recipient.pubkey(),
819822
&user_transfer_authority,
820823
&deposit_info.pool_account.pubkey(),
@@ -831,7 +834,7 @@ async fn success_with_small_preferred_withdraw() {
831834
.withdraw_stake(
832835
&mut context.banks_client,
833836
&context.payer,
834-
&context.last_blockhash,
837+
&last_blockhash,
835838
&user_stake_recipient.pubkey(),
836839
&user_transfer_authority,
837840
&deposit_info.pool_account.pubkey(),

0 commit comments

Comments
 (0)