From 682522e7d27024fdcb510c06c539399bbd8e2930 Mon Sep 17 00:00:00 2001 From: viktr Date: Thu, 25 Dec 2025 12:39:43 +0100 Subject: [PATCH 1/3] Fix: include UnwrapLamports (45) in TokenInstruction::try_from --- pinocchio/interface/src/instruction.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pinocchio/interface/src/instruction.rs b/pinocchio/interface/src/instruction.rs index 749dd65e..f387a1f4 100644 --- a/pinocchio/interface/src/instruction.rs +++ b/pinocchio/interface/src/instruction.rs @@ -547,7 +547,9 @@ impl TryFrom for TokenInstruction { fn try_from(value: u8) -> Result { match value { // SAFETY: `value` is guaranteed to be in the range of the enum variants. - 0..=24 | 38 | 255 => Ok(unsafe { core::mem::transmute::(value) }), + 0..=24 | 38 | 45 | 255 => { + Ok(unsafe { core::mem::transmute::(value) }) + } _ => Err(TokenError::InvalidInstruction.into()), } } @@ -599,7 +601,7 @@ mod tests { assert_eq!(TokenInstruction::try_from(variant_u8).unwrap(), variant); } } - + #[test] fn test_authority_type_from_u8_exhaustive() { for variant in AuthorityType::iter() { @@ -611,4 +613,4 @@ mod tests { assert_eq!(AuthorityType::try_from(variant_u8).unwrap(), variant); } } -} +} \ No newline at end of file From 9217af75c8dae511c97f1f5f828cd8236f1cdbe7 Mon Sep 17 00:00:00 2001 From: Fernando Otero Date: Fri, 9 Jan 2026 12:28:21 +0000 Subject: [PATCH 2/3] Fix formatting --- pinocchio/interface/src/instruction.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pinocchio/interface/src/instruction.rs b/pinocchio/interface/src/instruction.rs index f387a1f4..70a726f3 100644 --- a/pinocchio/interface/src/instruction.rs +++ b/pinocchio/interface/src/instruction.rs @@ -601,7 +601,7 @@ mod tests { assert_eq!(TokenInstruction::try_from(variant_u8).unwrap(), variant); } } - + #[test] fn test_authority_type_from_u8_exhaustive() { for variant in AuthorityType::iter() { @@ -613,4 +613,4 @@ mod tests { assert_eq!(AuthorityType::try_from(variant_u8).unwrap(), variant); } } -} \ No newline at end of file +} From 00c2ae9ca1499d3f509e2a149b78e366f4999501 Mon Sep 17 00:00:00 2001 From: Fernando Otero Date: Fri, 9 Jan 2026 12:29:20 +0000 Subject: [PATCH 3/3] Remove one last extra space --- pinocchio/interface/src/instruction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinocchio/interface/src/instruction.rs b/pinocchio/interface/src/instruction.rs index 70a726f3..80b44c15 100644 --- a/pinocchio/interface/src/instruction.rs +++ b/pinocchio/interface/src/instruction.rs @@ -601,7 +601,7 @@ mod tests { assert_eq!(TokenInstruction::try_from(variant_u8).unwrap(), variant); } } - + #[test] fn test_authority_type_from_u8_exhaustive() { for variant in AuthorityType::iter() {