light_program_test/utils/
create_account.rs

1use account_compression::processor::initialize_address_merkle_tree::Pubkey;
2use anchor_lang::solana_program::{instruction::Instruction, system_instruction};
3use solana_sdk::signature::{Keypair, Signer};
4
5pub fn create_account_instruction(
6    payer: &Pubkey,
7    size: usize,
8    rent: u64,
9    id: &Pubkey,
10    keypair: Option<&Keypair>,
11) -> Instruction {
12    let keypair = match keypair {
13        Some(keypair) => keypair.insecure_clone(),
14        None => Keypair::new(),
15    };
16    system_instruction::create_account(payer, &keypair.pubkey(), rent, size as u64, id)
17}