lang: Deprecate #[interface]
attribute
#3195
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Adding support for custom discriminators made the
#[interface]
attribute redundant, since the only thing this attribute does is to override the instruction's discriminator. For example:anchor/tests/spl/transfer-hook/programs/transfer-hook/src/lib.rs
Line 71 in e6d7daf
can now be replaced with:
#[instruction(discriminator = ExecuteInstruction::SPL_DISCRIMINATOR_SLICE)]
Many ways to achieve the same thing often leads to confusion for users, and also extra bloat in our codebase.
Summary of changes
Deprecate the
#[interface]
attribute and add a deprecation note explaining how to migrate.Note: This PR is part of a greater effort explained in #3097.