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

lang: Reuse common override arguments #3154

Conversation

acheroncrypto
Copy link
Collaborator

Problem

The new discriminator = <EXPR> argument can be used with #[instruction], #[account], and #[event] attributes, but they don't share code between each other, which results in unnecessary duplication.

Summary of changes

Add a new Overrides struct that can be shared between all previously mentioned attributes above.

The implementation is slightly different for #[account] because it also has other arguments (zero copy and namespaces) that we'd like to keep backwards-compatible.

This change achieves the same functionality with less than half of the previous code.


Note: This PR is part of a greater effort explained in #3097.

Copy link

vercel bot commented Aug 6, 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 mentioned this pull request Aug 6, 2024
26 tasks
@acheroncrypto acheroncrypto merged commit dfb2de5 into coral-xyz:master Aug 6, 2024
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant