Refactor (#431)
This commit is contained in:
parent
d517f11af0
commit
f6ad2d6544
|
@ -833,13 +833,6 @@ function hasWormholePayload(
|
||||||
onChainInstructions: InstructionAccount[],
|
onChainInstructions: InstructionAccount[],
|
||||||
wormholeTools: WormholeTools
|
wormholeTools: WormholeTools
|
||||||
): boolean {
|
): boolean {
|
||||||
if (onChainInstructions.length !== 2) {
|
|
||||||
console.debug(
|
|
||||||
`Expected 2 instructions in the transaction, found ${onChainInstructions.length}`
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const [messagePDA] = getIxAuthorityPDA(
|
const [messagePDA] = getIxAuthorityPDA(
|
||||||
txPubkey,
|
txPubkey,
|
||||||
new anchor.BN(1),
|
new anchor.BN(1),
|
||||||
|
@ -854,16 +847,7 @@ function hasWormholePayload(
|
||||||
wormholeTools
|
wormholeTools
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return areEqualOnChainInstructions(wormholeIxs, onChainInstructions);
|
||||||
isEqualOnChainInstruction(
|
|
||||||
wormholeIxs[0],
|
|
||||||
onChainInstructions[0] as InstructionAccount
|
|
||||||
) &&
|
|
||||||
isEqualOnChainInstruction(
|
|
||||||
wormholeIxs[1],
|
|
||||||
onChainInstructions[1] as InstructionAccount
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isEqualOnChainInstruction(
|
function isEqualOnChainInstruction(
|
||||||
|
|
Loading…
Reference in New Issue