lang: derive arbitrary traits for the instruction data#2518
lang: derive arbitrary traits for the instruction data#2518skrrb wants to merge 4 commits intosolana-foundation:masterfrom
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 |
acheroncrypto
left a comment
There was a problem hiding this comment.
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
Arbitrarytrait for the anchor-generated instruction module when the program is compiled with thearbitraryfeature (this requires thearbitrarycrate).This is particularly useful for fuzzing. For example: