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: Support PDA resolution of call expressions that don't have any arguments #3485

Conversation

acheroncrypto
Copy link
Collaborator

Problem

Call expressions that have no arguments do not get resolved automatically. For example:

#[derive(Accounts)]
pub struct CallExprWithNoArgs<'info> {
    #[account(
        seeds = [System::id().as_ref()],
        seeds::program = System::id(),
        bump
    )]
    pub pda: UncheckedAccount<'info>,
}

This generates the following account (with no resolution information):

{ "name": "pda" }

However, we have all the necessary information to evaluate the key of pda during IDL build (because System::id() can be evaluated).

Summary of changes

Support PDA resolution of call expressions that don't have any arguments.

Copy link

vercel bot commented Jan 14, 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 feature labels Jan 14, 2025
@acheroncrypto acheroncrypto merged commit 23d1a2c into coral-xyz:master Jan 16, 2025
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature idl related to the IDL, either program or client side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant