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

Commit ab05e4e

Browse files
authored
token-2022: Fix flaky test (#2851)
1 parent 809c1a1 commit ab05e4e

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

token/program-2022/tests/transfer_fee.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,12 +1228,21 @@ async fn withdraw_withheld_tokens_from_mint() {
12281228
);
12291229

12301230
// fail frozen account
1231+
let account = create_and_transfer_to_account(
1232+
&token,
1233+
&alice_account,
1234+
&alice,
1235+
&alice.pubkey(),
1236+
amount,
1237+
decimals,
1238+
)
1239+
.await;
12311240
token
1232-
.freeze_account(&bob_account, &freeze_authority)
1241+
.freeze_account(&account, &freeze_authority)
12331242
.await
12341243
.unwrap();
12351244
let error = token
1236-
.withdraw_withheld_tokens_from_mint(&bob_account, &withdraw_withheld_authority)
1245+
.withdraw_withheld_tokens_from_mint(&account, &withdraw_withheld_authority)
12371246
.await
12381247
.unwrap_err();
12391248
assert_eq!(
@@ -1247,6 +1256,15 @@ async fn withdraw_withheld_tokens_from_mint() {
12471256
);
12481257

12491258
// set to none, fail
1259+
let account = create_and_transfer_to_account(
1260+
&token,
1261+
&alice_account,
1262+
&alice,
1263+
&alice.pubkey(),
1264+
amount,
1265+
decimals,
1266+
)
1267+
.await;
12501268
token
12511269
.set_authority(
12521270
token.get_address(),
@@ -1257,7 +1275,7 @@ async fn withdraw_withheld_tokens_from_mint() {
12571275
.await
12581276
.unwrap();
12591277
let error = token
1260-
.withdraw_withheld_tokens_from_mint(&alice_account, &withdraw_withheld_authority)
1278+
.withdraw_withheld_tokens_from_mint(&account, &withdraw_withheld_authority)
12611279
.await
12621280
.unwrap_err();
12631281
assert_eq!(

0 commit comments

Comments
 (0)