Skip to content

Conversation

@joncinque
Copy link
Contributor

Problem

DecodeError has been deprecated, so upgrading to the newest crate causes warnings.

Summary of changes

Implement the new solana_program_error::ToStr trait and remove some dependencies on the interface.

Note that I didn't update the reference implementation program.

#### Problem

`DecodeError` has been deprecated, so upgrading to the newest crate
causes warnings.

#### Summary of changes

Implement the new `solana_program_error::ToStr` trait and remove some
dependencies on the interface.

Note that I didn't update the reference implementation program.
@joncinque joncinque requested a review from febo May 30, 2025 22:46
Eq,
thiserror::Error,
num_derive::FromPrimitive,
num_enum::TryFromPrimitive,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if we want to generally recommend that people use this instead. Since ToStr requires that the enum implements TryFrom<u32>, this seemed like the easiest option.

If so, we should add that to the help text in the deprecation warning

Copy link

Choose a reason for hiding this comment

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

Agree, I think is a good idea to provide a recommendation. I wonder if we add something to the docs of the ToStr with an example will be easier to provide more context.

Copy link

@febo febo left a comment

Choose a reason for hiding this comment

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

Looks great!

@joncinque joncinque merged commit dc33975 into solana-program:main Jun 2, 2025
10 checks passed
@joncinque joncinque deleted the bumperrs branch June 2, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants