Skip to content

Programs accounts are duplicated #9

Open
@julianzamt

Description

@julianzamt

Describe the bug
As informed in #7 , csl_spl_token.initialize_mint2 generates in processor csl_spl_token_v_0_0_0_info as var name. However, using csl_spl_token.mint_to produces token_program_info, therefore duplicating the need for the token program account.

Later was found that just using csl_spl_token.mint_to produces the duplicated accounts. This behavior was masked by the aforementioned.

To Reproduce

methods:
  - name: create_and_mint
    uses:
      - csl_spl_token.initialize_mint2
      - csl_spl_token.initialize_account3
      - csl_spl_token.mint_to
    inputs:
      - name: mint
        type: csl_spl_token.Mint
        solana:
          attributes: [ init ]
      - name: regular_token_account
        type: csl_spl_token.Account
        solana:
          attributes: [ init ]

In processor:

let account_info_iter = &mut accounts.iter();
let fee_payer_info = next_account_info(account_info_iter)?;
let mint_info = next_account_info(account_info_iter)?;
let regular_token_account_info = next_account_info(account_info_iter)?;
let system_program_info = next_account_info(account_info_iter)?;
let account_info = next_account_info(account_info_iter)?;
let assoc_token_account_info = next_account_info(account_info_iter)?;
let owner_info = next_account_info(account_info_iter)?;
let wallet_info = next_account_info(account_info_iter)?;
let token_program_info = next_account_info(account_info_iter)?; -------------------> token program account expected
let csl_spl_token_v_0_0_0_info = next_account_info(account_info_iter)?;  -------------------> token program account expected

Expected behavior
To use only one name (preferrably token_program_info) and to not duplicate the inputs.

Código CLI version:

  • Version v0.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    BacklogStuff to be done in the futureBugThis is an item that causes unwanted behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions