coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.63k stars 1.33k forks source link

lang: use underscore _ to prefix all internal names in account constraints code generation #2152

Open armaniferrante opened 2 years ago

armaniferrante commented 2 years ago

For example, the payer = <> here should be used with an underscore in the code gen.

#[derive(Accounts)]
pub struct Initialize<'info> {
    #[account(mut)]
    fee_payer: Signer<'info>,
    payer: UncheckedAccount<'info>,
    receiver: UncheckedAccount<'info>,
    #[account(init, seeds = [AccountRecord::PREFIX.as_ref(), payer.key().as_ref()], bump, space=AccountRecord::SIZE, payer = fee_payer)]
    account_record: Account<'info, AccountRecord>,
    system_program: Program<'info, System>,
}
stegaBOB commented 2 years ago

Please assign me to this one @armaniferrante!

patrickishaf commented 1 year ago

Don't know if this issue is still there but I've searched for this struct in codegen and the entirety of lang. I couldn't find it. Has it been removed from the codebase?