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: Fix using account or arg values for seeds::program #3570

Conversation

acheroncrypto
Copy link
Collaborator

Problem

Passing an account or an argument to seeds::program results in a compile error.

For example, using the following accounts struct:

#[derive(Accounts)]
pub struct Test<'info> {
    #[account(
        seeds = [b"*"],
        seeds::program = some_program,
        bump
    )]
    pub pda: UncheckedAccount<'info>,
    pub some_program: Program<'info, System>,
}

and running anchor idl build results in:

error[E0425]: cannot find value `some_program` in this scope
  --> programs/program/src/lib.rs:20:26
   |
20 |         seeds::program = some_program,
   |                          ^^^^^^^^^^^^ not found in this scope

Dynamic values are generally not supported, but we have a few exceptions for accounts and arguments. Given this kind usage already works for regular seeds, it should also work for seeds::program.

Summary of changes

Fix being unable to use account or argument values for seeds::program during IDL generation.

Fixes #3471

Copy link

vercel bot commented Feb 23, 2025

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added idl related to the IDL, either program or client side fix Bug fix PR labels Feb 23, 2025
@acheroncrypto acheroncrypto merged commit b6b4f11 into coral-xyz:master Feb 23, 2025
52 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PR idl related to the IDL, either program or client side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Anchor idl build fails on seeds::program constraint
1 participant