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

IDL Does Not Generate Account Objects For Accounts Not Directly Used In An Instruction #176

Closed
bonedaddy opened this issue Apr 12, 2021 · 1 comment
Labels
cli good first issue Good for newcomers help wanted Extra attention is needed lang priority:1

Comments

@bonedaddy
Copy link
Contributor

Overview

I have a program that uses some account which is never passed into the program via an instruction directly. For example I use it to track balance like so:

            let mut balance_account: ProgramAccount<VaultBalanceEntry> = anchor_lang::ProgramAccount::try_accounts_init(ctx.program_id, &mut &[ctx.accounts.user_balance_account.clone()][..])?;
            balance_account.owner = vault.pda;
            balance_account.amount = amount;
            balance_account.account_index = vault.account_index;
            balance_account.exit(ctx.program_id)?;

But within the test framework when printing out the available accounts in the IDL it does not show up:

  account: {
    vault: [AsyncFunction: accountsNamespace] {
      size: 186,
      createInstruction: [AsyncFunction],
      subscribe: [Function],
      unsubscribe: [Function],
      all: [AsyncFunction]
    }
  },

Version Information

  • Anchor 0.4.1
@armaniferrante
Copy link
Member

Addressed by #177.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli good first issue Good for newcomers help wanted Extra attention is needed lang priority:1
Projects
None yet
Development

No branches or pull requests

2 participants