Uh oh!
There was an error while loading. Please reload this page.
pinocchio-interface: include UnwrapLamports (45) in TokenInstruction::try_from - #118
Merged
joncinque merged 3 commits intoJan 9, 2026
Conversation
febo
commented
Jan 8, 2026
Contributor
@victorchukwuemeka Looks good – I think we need to remove the extra blank spaces that were added so CI passes. |
febo
reviewed
Jan 8, 2026
| use {crate::error::TokenError, pinocchio::program_error::ProgramError}; | ||
febo
reviewed
Jan 8, 2026
Comment on lines
+540
to
+541
febo
reviewed
Jan 8, 2026
| AccountOwner, | ||
| /// Authority to close a token account | ||
| CloseAccount, | ||
febo
reviewed
Jan 8, 2026
| assert_eq!( | ||
| TokenInstruction::from_repr(variant_u8), | ||
| Some(TokenInstruction::try_from(variant_u8).unwrap()) | ||
febo
reviewed
Jan 8, 2026
Comment on lines
+607
to
+608
victorchukwuemeka
commented
Jan 8, 2026
ContributorAuthor
okay i;m clearing the spaces now |
victorchukwuemekaforce-pushed
the
fix/pinocchio-instruction-variant
branch
2 times, most recently
from
January 8, 2026 14:24
2600e50 to
ead864cComparevictorchukwuemeka
commented
Jan 8, 2026
ContributorAuthor
@febo i have cleaned the spaces |
febo
commented
Jan 8, 2026
Contributor
There are a couple ones left. |
febo
reviewed
Jan 8, 2026
| } | ||
| } | ||
victorchukwuemekaforce-pushed
the
fix/pinocchio-instruction-variant
branch
from
January 8, 2026 15:59
ead864c to
851ffe1Comparefebo
reviewed
Jan 8, 2026
| match value { | ||
| // SAFETY: `value` is guaranteed to be in the range of the enum variants. | ||
| 0..=24 | 38 | 255 => Ok(unsafe { core::mem::transmute::<u8, TokenInstruction>(value) }), | ||
| 0..=24 | 38 | 45 | 255 => Ok(unsafe { core::mem::transmute::<u8, TokenInstruction>(value) }), |
Contributor
There was a problem hiding this comment.
nit: Last nit for CI.
Suggested change
| 0..=24 | 38 | 45 | 255 => Ok(unsafe{ core::mem::transmute::<u8,TokenInstruction>(value)}), | |
| 0..=24 | 38 | 45 | 255 => { | |
| Ok(unsafe{ core::mem::transmute::<u8,TokenInstruction>(value)}) | |
| } |
victorchukwuemekaforce-pushed
the
fix/pinocchio-instruction-variant
branch
from
January 9, 2026 10:10
87e83b9 to
682522eComparejoncinque
approved these changes
Jan 9, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
The TryFrom implementation for TokenInstruction was missing the
UnwrapLamports = 45 variant, causing
test_token_instruction_from_u8_exhaustive to fail.
This PR adds the missing variant to keep the conversion logic in sync with
the enum definition.