Fix bad system instruction type handling
This commit is contained in:
parent
6c8a5747f7
commit
e31b30c595
|
@ -58,9 +58,9 @@ export function decodeTransfer(
|
||||||
ix: TransactionInstruction
|
ix: TransactionInstruction
|
||||||
): TransferParams | null {
|
): TransferParams | null {
|
||||||
if (!ix.programId.equals(SystemProgram.programId)) return null;
|
if (!ix.programId.equals(SystemProgram.programId)) return null;
|
||||||
if (SystemInstruction.decodeInstructionType(ix) !== "Transfer") return null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (SystemInstruction.decodeInstructionType(ix) !== "Transfer") return null;
|
||||||
return SystemInstruction.decodeTransfer(ix);
|
return SystemInstruction.decodeTransfer(ix);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(ix, err);
|
console.error(ix, err);
|
||||||
|
@ -72,9 +72,9 @@ export function decodeCreate(
|
||||||
ix: TransactionInstruction
|
ix: TransactionInstruction
|
||||||
): CreateAccountParams | null {
|
): CreateAccountParams | null {
|
||||||
if (!ix.programId.equals(SystemProgram.programId)) return null;
|
if (!ix.programId.equals(SystemProgram.programId)) return null;
|
||||||
if (SystemInstruction.decodeInstructionType(ix) !== "Create") return null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (SystemInstruction.decodeInstructionType(ix) !== "Create") return null;
|
||||||
return SystemInstruction.decodeCreateAccount(ix);
|
return SystemInstruction.decodeCreateAccount(ix);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(ix, err);
|
console.error(ix, err);
|
||||||
|
|
Loading…
Reference in New Issue