Skip to content

Commit d3e5fcf

Browse files
committed
Fix try_from for TokenInstruction
1 parent 90b8f5c commit d3e5fcf

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
- name: Lint
6262
run: pnpm programs:lint
6363

64-
format_and_lint_pinterface:
65-
name: Format & Lint P-Interface
64+
format_lint_and_test_pinterface:
65+
name: Format, Lint & Test P-Interface
6666
runs-on: ubuntu-latest
6767
steps:
6868
- name: Git Checkout
@@ -80,6 +80,9 @@ jobs:
8080
- name: Lint
8181
run: pnpm p-interface:lint
8282

83+
- name: Test
84+
run: pnpm p-interface:test
85+
8386
format_and_lint_ptoken:
8487
name: Format & Lint p-token
8588
runs-on: ubuntu-latest
@@ -99,7 +102,7 @@ jobs:
99102
- name: Lint
100103
run: pnpm p-token:lint
101104

102-
format_and_lint_interface:
105+
format_lint_and_test_interface:
103106
name: Format, Lint & Test Interface
104107
runs-on: ubuntu-latest
105108
steps:
@@ -118,7 +121,7 @@ jobs:
118121
- name: Lint
119122
run: pnpm interface:lint
120123

121-
- name: Lint
124+
- name: Test
122125
run: pnpm interface:test
123126

124127
audit_rust:
@@ -214,7 +217,7 @@ jobs:
214217
build_ptoken:
215218
name: Build p-token
216219
runs-on: ubuntu-latest
217-
needs: [format_and_lint_pinterface, format_and_lint_ptoken]
220+
needs: [format_lint_and_test_pinterface, format_and_lint_ptoken]
218221
steps:
219222
- name: Git Checkout
220223
uses: actions/checkout@v4

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"fixtures:run": "zx ./scripts/rust/fixtures.mjs run",
3434
"p-interface:format": "zx ./scripts/rust/format.mjs pinocchio/interface",
3535
"p-interface:lint": "zx ./scripts/rust/lint.mjs pinocchio/interface",
36+
"p-interface:test": "zx ./scripts/rust/test.mjs pinocchio/interface",
3637
"interface:format": "zx ./scripts/rust/format.mjs interface",
3738
"interface:lint": "zx ./scripts/rust/lint.mjs interface",
3839
"interface:test": "zx ./scripts/rust/test.mjs interface"

pinocchio/interface/src/instruction.rs

Lines changed: 1 addition & 1 deletion
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
}

0 commit comments

Comments
 (0)