lang: Remove discriminator method from Discriminator trait#3163
Merged
acheroncrypto merged 3 commits intoAug 10, 2024
Conversation
|
@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
26 tasks
andreisilviudragnea
added a commit
to andreisilviudragnea/solana-test-framework
that referenced
this pull request
Aug 14, 2024
andreisilviudragnea
added a commit
to andreisilviudragnea/solana-test-framework
that referenced
this pull request
Aug 14, 2024
andreisilviudragnea
added a commit
to andreisilviudragnea/solana-test-framework
that referenced
this pull request
Aug 14, 2024
andreisilviudragnea
added a commit
to andreisilviudragnea/solana-test-framework
that referenced
this pull request
Aug 14, 2024
andreisilviudragnea
added a commit
to andreisilviudragnea/solana-test-framework
that referenced
this pull request
Aug 14, 2024
andreisilviudragnea
added a commit
to andreisilviudragnea/solana-test-framework
that referenced
this pull request
Aug 14, 2024
andreisilviudragnea
added a commit
to andreisilviudragnea/solana-test-framework
that referenced
this pull request
Aug 14, 2024
halbornteam
pushed a commit
to halbornteam/solana-test-framework
that referenced
this pull request
Nov 4, 2024
- Cargo.lock removed from .gitignore (previous recommendation to not check in Cargo.lock for libraries has changed) - Deploy non-upgradable program is no longer supported (solana-labs/solana#34424) - deploy_program function was kept for backwards compatibility but now uses upgradable loader) - Fixed outdate processor macro. Also now it is possible to use this macro with new anchor entrypoint function. - Updated structure of the new Pyth Oracle price account. - Replaced various deprecated functions and structs with new equivalents. - Fixed most of the compiler warnings. - Bumped dependencies versions. - Fixed create_associated_token_account to work with spl_token_2022::ID as suggested in [PR#23](#23). - Fixed add_empty_account_with_anchor to work with future Anchor versions: otter-sec/anchor#3163 as suggested in [PR#23](#23).
Ikrk
added a commit
to halbornteam/solana-test-framework
that referenced
this pull request
May 6, 2025
- Cargo.lock removed from .gitignore (previous recommendation to not check in Cargo.lock for libraries has changed) - Deploy non-upgradable program is no longer supported (solana-labs/solana#34424) - deploy_program function was kept for backwards compatibility but now uses upgradable loader) - Fixed outdate processor macro. Also now it is possible to use this macro with new anchor entrypoint function. - Updated structure of the new Pyth Oracle price account. - Replaced various deprecated functions and structs with new equivalents. - Fixed most of the compiler warnings. - Bumped dependencies versions. - Fixed create_associated_token_account to work with spl_token_2022::ID as suggested in [PR#23](#23). - Fixed add_empty_account_with_anchor to work with future Anchor versions: otter-sec/anchor#3163 as suggested in [PR#23](#23).
Draviener
added a commit
to Draviener/framework-solana-test
that referenced
this pull request
Oct 22, 2025
- Cargo.lock removed from .gitignore (previous recommendation to not check in Cargo.lock for libraries has changed) - Deploy non-upgradable program is no longer supported (solana-labs/solana#34424) - deploy_program function was kept for backwards compatibility but now uses upgradable loader) - Fixed outdate processor macro. Also now it is possible to use this macro with new anchor entrypoint function. - Updated structure of the new Pyth Oracle price account. - Replaced various deprecated functions and structs with new equivalents. - Fixed most of the compiler warnings. - Bumped dependencies versions. - Fixed create_associated_token_account to work with spl_token_2022::ID as suggested in [PR#23](halbornteam/solana-test-framework#23). - Fixed add_empty_account_with_anchor to work with future Anchor versions: otter-sec/anchor#3163 as suggested in [PR#23](halbornteam/solana-test-framework#23).
Otter-0x4ka5h
pushed a commit
to Otter-0x4ka5h/anchor
that referenced
this pull request
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
There is no reason to have both an associated constant and a method that returns the exact same thing, as in the case with the
Discriminatortrait:https://github.com/coral-xyz/anchor/blob/bb809fd1df295fb9b7c1cc7596c5c6ccece4c2cf/lang/src/lib.rs#L304-L309
The reason why both exist is likely because of backwards compatibility reasons (
DISCRIMINATORconstant was added after thediscriminatormethod).This is no longer necessary, and it's fitting to remove it now that the return type has also changed.
Summary of changes
Remove the
discriminatormethod of theDiscriminatortrait.Note: This PR is part of a greater effort explained in #3097.