Skip to content

lang: Remove discriminator method from Discriminator trait#3163

Merged
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:lang-remove-discriminator-method-from-discriminator-trait
Aug 10, 2024
Merged

lang: Remove discriminator method from Discriminator trait#3163
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:lang-remove-discriminator-method-from-discriminator-trait

Conversation

@acheroncrypto

Copy link
Copy Markdown
Collaborator

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 Discriminator trait:

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 (DISCRIMINATOR constant was added after the discriminator method).

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 discriminator method of the Discriminator trait.


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

@vercel

vercel Bot commented Aug 10, 2024

Copy link
Copy Markdown

@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 merged commit 46f52da into otter-sec:master Aug 10, 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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant