Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programs accounts are duplicated #9

Open
julianzamt opened this issue Aug 29, 2023 · 1 comment
Open

Programs accounts are duplicated #9

julianzamt opened this issue Aug 29, 2023 · 1 comment
Labels
Backlog Stuff to be done in the future Bug This is an item that causes unwanted behavior

Comments

@julianzamt
Copy link

julianzamt commented Aug 29, 2023

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
@julianzamt julianzamt added the Triage This item needs to be prioritize label Aug 29, 2023
@julianzamt julianzamt changed the title Token Program account created twice Token Program account expected twice Aug 29, 2023
@JazielGuerrero JazielGuerrero added Bug This is an item that causes unwanted behavior Todo This item hasn't been started and removed Triage This item needs to be prioritize labels Aug 30, 2023
@JazielGuerrero JazielGuerrero changed the title Token Program account expected twice Programs accounts are duplicated Sep 2, 2023
@JazielGuerrero
Copy link
Collaborator

Change the title of this ticket to put related tickets like this one #27 under it.

@JazielGuerrero JazielGuerrero added todo and removed todo labels Sep 2, 2023
@JazielGuerrero JazielGuerrero added Backlog Stuff to be done in the future and removed Todo This item hasn't been started labels Dec 5, 2023
@JazielGuerrero JazielGuerrero removed their assignment Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Stuff to be done in the future Bug This is an item that causes unwanted behavior
Projects
None yet
Development

No branches or pull requests

2 participants