-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
lang: derive arbitrary traits for the instruction data #2518
Conversation
@skrrb is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
synced with master. for reference, this is what openbook fuzz test currently use https://github.com/openbook-dex/openbook-v2/blob/8928d4cb23efe4864fc05aab9f00519eacf83720/programs/openbook-v2/fuzz/Cargo.toml#L28 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. However, I think we should be able to support custom instruction attributes on the framework level with #2339, which I'm planning to get in for the next release. That specific PR currently doesn't support cfg_attr
, but we should easily be able to add support for that too.
Overall, having generic support seems much better than hardcoding this feature in the codegen.
oh, i was not aware of that PR, will take a close look. However, a quick question i'm not really sure how to solve with this approach: how should be differentiated if the attributes need to be applied to the function itself, or only to the underlying |
Wouldn't applying |
closed in favor of #2963 |
implements
Arbitrary
trait for the anchor-generated instruction module when the program is compiled with thearbitrary
feature (this requires thearbitrary
crate).This is particularly useful for fuzzing. For example: