From f6ad2d6544f31e5f0315144af0de1f141f692494 Mon Sep 17 00:00:00 2001 From: guibescos <59208140+guibescos@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:20:32 +0100 Subject: [PATCH] Refactor (#431) --- .../multisig-wh-message-builder/src/index.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/third_party/pyth/multisig-wh-message-builder/src/index.ts b/third_party/pyth/multisig-wh-message-builder/src/index.ts index 10b05465..7f7dec83 100644 --- a/third_party/pyth/multisig-wh-message-builder/src/index.ts +++ b/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(