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

Deprecate DecodeError #2046

Closed

Conversation

kevinheavey
Copy link

Problem

DecodeError is just a useless wrapper around num_traits::FromPrimitive since the type_of() method isn't used

Summary of Changes

  • Deprecate it and don't implement it for anything in the repo
  • Remove it as a constraint from PrintProgramError

Copy link

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor, but a few important bits about deprecation here.

  • In order to break less stuff downstream (and be semver compatible-ish), we can't remove the trait constraint from PrintProgramError until the trait is removed and the breaking change is introduced.
  • We also shouldn't drop implementations of DecodeError for types like Pubkey until the trait is dropped as well.

With those two points respected, this trait effectively becomes a no-op for PrintProgramError, but we (and other projects besides SPL) can go and evict the deprecated trait from error implementations before the trait is dropped completely.

@kevinheavey
Copy link
Author

kevinheavey commented Jul 10, 2024

Yeah thinking about it more it doesn't make sense to give people a deprecation warning when they still need to use DecodeError to implement PrintProgramError which is not being deprecated. Just need to wait for 3.0 to get rid of DecodeError I think

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.

2 participants