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

[Solana][readability] PluginType type safety #631

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PabloMansanet
Copy link
Contributor

Minor type safety/readability improvement. Since zero_copy serialization of enums isn't possible, we stored the plugin type as a u8 in many places, but it can be made a bit safer with an additional type wrapper.

@PabloMansanet PabloMansanet requested a review from a team as a code owner February 19, 2025 10:53
Copy link

Metric readability_post_audit main
Coverage 74.2% 73.8%

@@ -95,7 +99,7 @@ pub trait Admin {
fn set_ocr_config(
&self,
ctx: Context<SetOcrConfig>,
plugin_type: u8, // OcrPluginType, u8 used because anchor tests did not work with an enum
plugin_type: OcrPluginType,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a breaking change? If yes, then we need to inform tooling team to update their interactions as well.

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