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: Generation fails if struct is not from the same program. #2531

Closed
SushantChandla opened this issue Jun 14, 2023 · 2 comments
Closed

IDL: Generation fails if struct is not from the same program. #2531

SushantChandla opened this issue Jun 14, 2023 · 2 comments
Labels
idl related to the IDL, either program or client side

Comments

@SushantChandla
Copy link

If we have 2 programs one of them has a account T:

Program1:

pub struct T{
pub seeds: String
}

And in the second program for the context if I try to do something like:
Program2:

use program1::struct::T;

pub struct Accounts{
#[account(
        seeds = [account_t.seeds.as_bytes()],
        bump ,
        seeds::program = program1::ID,
    )]
  pub account_t: Account<T>
}

Fails as an option is unwrapped:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', lang/syn/src/idl/pda.rs:225:37
@tanmaymunjal
Copy link

tanmaymunjal commented Jul 8, 2023

Hey @SushantChandla, thanks for raising the issue

I was not able to reproduce this issue on my local. Can you please post the Anchor.toml and Cargo.toml configurations here? Also would be helpful if you could upload a complete piece of code on which this issue is easily reproducable.I am using Anchor v0.28.0 on my programs just for context.

@acheroncrypto acheroncrypto mentioned this issue Feb 25, 2024
@acheroncrypto acheroncrypto added the idl related to the IDL, either program or client side label Mar 10, 2024
@acheroncrypto
Copy link
Collaborator

Fixed in #2824.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idl related to the IDL, either program or client side
Projects
None yet
Development

No branches or pull requests

3 participants