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 not exporting an enum, no warning or error. #2748

Closed
ohaddahan opened this issue Dec 25, 2023 · 1 comment
Closed

IDL not exporting an enum, no warning or error. #2748

ohaddahan opened this issue Dec 25, 2023 · 1 comment
Labels
bug Something isn't working idl related to the IDL, either program or client side

Comments

@ohaddahan
Copy link

Bad

#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, PartialEq)]
pub enum AdminActions {
    NoAction,
    Pause,
    Unpause,
    AddToken(Pubkey),
    RemoveToken(Pubkey),
    AddOwner(Pubkey),
    RemoveOwner(Pubkey),
    Withdraw((Pubkey, u64)),
}

Good

#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, PartialEq)]
pub enum AdminActions {
    NoAction,
    Pause,
    Unpause,
    AddToken(Pubkey),
    RemoveToken(Pubkey),
    AddOwner(Pubkey),
    RemoveOwner(Pubkey),
    Withdraw(Pubkey, u64),
}

The difference is Withdraw inner tuple. This cause the type to be reference in the resulting IDL , but it's not defined in the types section.

If this is an unsupported type , it should warn/error about it.

@acheroncrypto acheroncrypto added bug Something isn't working idl related to the IDL, either program or client side labels Dec 26, 2023
@acheroncrypto acheroncrypto mentioned this issue Feb 25, 2024
@acheroncrypto
Copy link
Collaborator

Fixed by #2824.

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

No branches or pull requests

2 participants