|
8 | 8 |
|
9 | 9 | import { |
10 | 10 | containsBytes, |
11 | | - getU8Encoder, |
| 11 | + getU32Encoder, |
12 | 12 | type Address, |
13 | 13 | type ReadonlyUint8Array, |
14 | 14 | } from '@solana/web3.js'; |
@@ -41,28 +41,28 @@ export function identifyLoaderV3Instruction( |
41 | 41 | instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array |
42 | 42 | ): LoaderV3Instruction { |
43 | 43 | const data = 'data' in instruction ? instruction.data : instruction; |
44 | | - if (containsBytes(data, getU8Encoder().encode(0), 0)) { |
| 44 | + if (containsBytes(data, getU32Encoder().encode(0), 0)) { |
45 | 45 | return LoaderV3Instruction.InitializeBuffer; |
46 | 46 | } |
47 | | - if (containsBytes(data, getU8Encoder().encode(1), 0)) { |
| 47 | + if (containsBytes(data, getU32Encoder().encode(1), 0)) { |
48 | 48 | return LoaderV3Instruction.Write; |
49 | 49 | } |
50 | | - if (containsBytes(data, getU8Encoder().encode(2), 0)) { |
| 50 | + if (containsBytes(data, getU32Encoder().encode(2), 0)) { |
51 | 51 | return LoaderV3Instruction.DeployWithMaxDataLen; |
52 | 52 | } |
53 | | - if (containsBytes(data, getU8Encoder().encode(3), 0)) { |
| 53 | + if (containsBytes(data, getU32Encoder().encode(3), 0)) { |
54 | 54 | return LoaderV3Instruction.Upgrade; |
55 | 55 | } |
56 | | - if (containsBytes(data, getU8Encoder().encode(4), 0)) { |
| 56 | + if (containsBytes(data, getU32Encoder().encode(4), 0)) { |
57 | 57 | return LoaderV3Instruction.SetAuthority; |
58 | 58 | } |
59 | | - if (containsBytes(data, getU8Encoder().encode(5), 0)) { |
| 59 | + if (containsBytes(data, getU32Encoder().encode(5), 0)) { |
60 | 60 | return LoaderV3Instruction.Close; |
61 | 61 | } |
62 | | - if (containsBytes(data, getU8Encoder().encode(6), 0)) { |
| 62 | + if (containsBytes(data, getU32Encoder().encode(6), 0)) { |
63 | 63 | return LoaderV3Instruction.ExtendProgram; |
64 | 64 | } |
65 | | - if (containsBytes(data, getU8Encoder().encode(7), 0)) { |
| 65 | + if (containsBytes(data, getU32Encoder().encode(7), 0)) { |
66 | 66 | return LoaderV3Instruction.SetAuthorityChecked; |
67 | 67 | } |
68 | 68 | throw new Error( |
|
0 commit comments