Skip to content

Commit 9da907d

Browse files
committed
solana: Add new bad_mint_authority to test setup functions
1 parent c2ebec3 commit 9da907d

File tree

1 file changed

+6
-3
lines changed
  • solana/programs/example-native-token-transfers/tests/common

1 file changed

+6
-3
lines changed

solana/programs/example-native-token-transfers/tests/common/setup.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub struct TestData {
5555
pub program_owner: Keypair,
5656
pub mint_authority: Keypair,
5757
pub mint: Pubkey,
58+
pub bad_mint_authority: Keypair,
5859
pub bad_mint: Pubkey,
5960
pub user: Keypair,
6061
pub user_token_account: Pubkey,
@@ -238,6 +239,7 @@ pub async fn setup_accounts(ctx: &mut ProgramTestContext, program_owner: Keypair
238239
let mint_authority = Keypair::new();
239240

240241
let bad_mint = Keypair::new();
242+
let bad_mint_authority = Keypair::new();
241243

242244
let user = Keypair::new();
243245
let payer = ctx.payer.pubkey();
@@ -248,7 +250,7 @@ pub async fn setup_accounts(ctx: &mut ProgramTestContext, program_owner: Keypair
248250
.await
249251
.unwrap();
250252

251-
create_mint(ctx, &bad_mint, &mint_authority.pubkey(), 9)
253+
create_mint(ctx, &bad_mint, &bad_mint_authority.pubkey(), 9)
252254
.await
253255
.submit(ctx)
254256
.await
@@ -301,12 +303,12 @@ pub async fn setup_accounts(ctx: &mut ProgramTestContext, program_owner: Keypair
301303
&Token::id(),
302304
&bad_mint.pubkey(),
303305
&bad_user_token_account,
304-
&mint_authority.pubkey(),
306+
&bad_mint_authority.pubkey(),
305307
&[],
306308
MINT_AMOUNT,
307309
)
308310
.unwrap()
309-
.submit_with_signers(&[&mint_authority], ctx)
311+
.submit_with_signers(&[&bad_mint_authority], ctx)
310312
.await
311313
.unwrap();
312314

@@ -317,6 +319,7 @@ pub async fn setup_accounts(ctx: &mut ProgramTestContext, program_owner: Keypair
317319
program_owner,
318320
mint_authority,
319321
mint: mint.pubkey(),
322+
bad_mint_authority,
320323
bad_mint: bad_mint.pubkey(),
321324
user,
322325
user_token_account,

0 commit comments

Comments
 (0)