Skip to content

Commit

Permalink
solana: Add new bad_mint_authority to test setup functions
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsaigle committed Mar 22, 2024
1 parent c2ebec3 commit 9da907d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub struct TestData {
pub program_owner: Keypair,
pub mint_authority: Keypair,
pub mint: Pubkey,
pub bad_mint_authority: Keypair,
pub bad_mint: Pubkey,
pub user: Keypair,
pub user_token_account: Pubkey,
Expand Down Expand Up @@ -238,6 +239,7 @@ pub async fn setup_accounts(ctx: &mut ProgramTestContext, program_owner: Keypair
let mint_authority = Keypair::new();

let bad_mint = Keypair::new();
let bad_mint_authority = Keypair::new();

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

create_mint(ctx, &bad_mint, &mint_authority.pubkey(), 9)
create_mint(ctx, &bad_mint, &bad_mint_authority.pubkey(), 9)
.await
.submit(ctx)
.await
Expand Down Expand Up @@ -301,12 +303,12 @@ pub async fn setup_accounts(ctx: &mut ProgramTestContext, program_owner: Keypair
&Token::id(),
&bad_mint.pubkey(),
&bad_user_token_account,
&mint_authority.pubkey(),
&bad_mint_authority.pubkey(),
&[],
MINT_AMOUNT,
)
.unwrap()
.submit_with_signers(&[&mint_authority], ctx)
.submit_with_signers(&[&bad_mint_authority], ctx)
.await
.unwrap();

Expand All @@ -317,6 +319,7 @@ pub async fn setup_accounts(ctx: &mut ProgramTestContext, program_owner: Keypair
program_owner,
mint_authority,
mint: mint.pubkey(),
bad_mint_authority,
bad_mint: bad_mint.pubkey(),
user,
user_token_account,
Expand Down

0 comments on commit 9da907d

Please sign in to comment.