Skip to content

idl: Fix panicking on tests #3197

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

Conversation

acheroncrypto
Copy link
Collaborator

Problem

The IDL generation has an optional type alias resolution feature that parses the crate code starting from the crate's root (lib.rs). The current code simply uses .expect because it's expected that all Solana programs have this file, but if there is a tests folder inside the program directory, this code panics:

https://github.com/coral-xyz/anchor/blob/679c1306f39f529bebf72b4f4d2bfa4a54b633c4/lang/syn/src/idl/defined.rs#L500

Summary of changes

Fix panicking when lib.rs file doesn't exist.

Copy link

vercel bot commented Aug 25, 2024

@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 Aug 25, 2024
@acheroncrypto acheroncrypto merged commit 0498580 into solana-foundation:master Aug 25, 2024
0 of 3 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.

1 participant