guibescos 2 년 전
부모
커밋
f6ad2d6544
1개의 변경된 파일1개의 추가작업 그리고 17개의 파일을 삭제
  1. 1 17
      third_party/pyth/multisig-wh-message-builder/src/index.ts

+ 1 - 17
third_party/pyth/multisig-wh-message-builder/src/index.ts

@@ -833,13 +833,6 @@ function hasWormholePayload(
   onChainInstructions: InstructionAccount[],
   wormholeTools: WormholeTools
 ): boolean {
-  if (onChainInstructions.length !== 2) {
-    console.debug(
-      `Expected 2 instructions in the transaction, found ${onChainInstructions.length}`
-    );
-    return false;
-  }
-
   const [messagePDA] = getIxAuthorityPDA(
     txPubkey,
     new anchor.BN(1),
@@ -854,16 +847,7 @@ function hasWormholePayload(
     wormholeTools
   );
 
-  return (
-    isEqualOnChainInstruction(
-      wormholeIxs[0],
-      onChainInstructions[0] as InstructionAccount
-    ) &&
-    isEqualOnChainInstruction(
-      wormholeIxs[1],
-      onChainInstructions[1] as InstructionAccount
-    )
-  );
+  return areEqualOnChainInstructions(wormholeIxs, onChainInstructions);
 }
 
 function isEqualOnChainInstruction(