|
1 | | -use anchor_lang::InstructionData; |
| 1 | +use anchor_lang::{InstructionData, ToAccountMetas}; |
2 | 2 | use light_client::indexer::AddressWithTree; |
3 | 3 | use light_program_test::{Indexer, LightProgramTest, ProgramTestConfig, Rpc}; |
4 | | -use light_token_anchor_create_ata::{instruction::CreateAta, ID}; |
| 4 | +use light_token_anchor_create_ata::{accounts, instruction::CreateAta, ID}; |
5 | 5 | use light_token::instruction::{ |
6 | 6 | CreateMint, CreateMintParams, config_pda, derive_mint_compressed_address, derive_token_ata, |
7 | 7 | find_mint_address, rent_sponsor_pda, LIGHT_TOKEN_PROGRAM_ID, |
8 | 8 | }; |
9 | 9 | use anchor_lang::system_program; |
10 | 10 | use solana_sdk::{ |
11 | | - instruction::{AccountMeta, Instruction}, |
| 11 | + instruction::Instruction, |
12 | 12 | signature::Keypair, |
13 | 13 | signer::Signer, |
14 | 14 | }; |
@@ -82,16 +82,17 @@ async fn test_create_ata() { |
82 | 82 |
|
83 | 83 | let ix = Instruction { |
84 | 84 | program_id: ID, |
85 | | - accounts: vec![ |
86 | | - AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), |
87 | | - AccountMeta::new_readonly(payer.pubkey(), false), |
88 | | - AccountMeta::new_readonly(mint_pda, false), |
89 | | - AccountMeta::new(payer.pubkey(), true), |
90 | | - AccountMeta::new(ata, false), |
91 | | - AccountMeta::new_readonly(system_program::ID, false), |
92 | | - AccountMeta::new_readonly(compressible_config, false), |
93 | | - AccountMeta::new(rent_sponsor, false), |
94 | | - ], |
| 85 | + accounts: accounts::CreateAtaAccounts { |
| 86 | + light_token_program: LIGHT_TOKEN_PROGRAM_ID, |
| 87 | + owner: payer.pubkey(), |
| 88 | + mint: mint_pda, |
| 89 | + payer: payer.pubkey(), |
| 90 | + associated_token_account: ata, |
| 91 | + system_program: system_program::ID, |
| 92 | + compressible_config, |
| 93 | + rent_sponsor, |
| 94 | + } |
| 95 | + .to_account_metas(Some(true)), |
95 | 96 | data: CreateAta { |
96 | 97 | bump: ata_bump, |
97 | 98 | idempotent: false, |
|
0 commit comments