stake-pool: Refresh blockhash earlier (#3988)

This commit is contained in:
Jon Cinque 2023-01-19 21:47:16 +01:00 committed by GitHub
parent 88684d52a2
commit 809bcfee41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -632,22 +632,22 @@ async fn fail_with_not_enough_tokens() {
tokens_to_burn, tokens_to_burn,
) = setup_for_withdraw(spl_token::id()).await; ) = setup_for_withdraw(spl_token::id()).await;
// Empty validator stake account
let empty_stake_account = simple_add_validator_to_pool(
&mut context.banks_client,
&context.payer,
&context.last_blockhash,
&stake_pool_accounts,
None,
)
.await;
let last_blockhash = context let last_blockhash = context
.banks_client .banks_client
.get_new_latest_blockhash(&context.last_blockhash) .get_new_latest_blockhash(&context.last_blockhash)
.await .await
.unwrap(); .unwrap();
// Empty validator stake account
let empty_stake_account = simple_add_validator_to_pool(
&mut context.banks_client,
&context.payer,
&last_blockhash,
&stake_pool_accounts,
None,
)
.await;
let new_authority = Pubkey::new_unique(); let new_authority = Pubkey::new_unique();
let error = stake_pool_accounts let error = stake_pool_accounts
.withdraw_stake( .withdraw_stake(