Skip to content

Commit 851ffe1

Browse files
Fix: include UnwrapLamports (45) in TokenInstruction::try_from
1 parent 90b8f5c commit 851ffe1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pinocchio/interface/src/instruction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl TryFrom<u8> for TokenInstruction {
547547
fn try_from(value: u8) -> Result<Self, Self::Error> {
548548
match value {
549549
// SAFETY: `value` is guaranteed to be in the range of the enum variants.
550-
0..=24 | 38 | 255 => Ok(unsafe { core::mem::transmute::<u8, TokenInstruction>(value) }),
550+
0..=24 | 38 | 45 | 255 => Ok(unsafe { core::mem::transmute::<u8, TokenInstruction>(value) }),
551551
_ => Err(TokenError::InvalidInstruction.into()),
552552
}
553553
}
@@ -599,7 +599,7 @@ mod tests {
599599
assert_eq!(TokenInstruction::try_from(variant_u8).unwrap(), variant);
600600
}
601601
}
602-
602+
603603
#[test]
604604
fn test_authority_type_from_u8_exhaustive() {
605605
for variant in AuthorityType::iter() {
@@ -611,4 +611,4 @@ mod tests {
611611
assert_eq!(AuthorityType::try_from(variant_u8).unwrap(), variant);
612612
}
613613
}
614-
}
614+
}

0 commit comments

Comments
 (0)