Skip to content

Commit

Permalink
Add basic TS test covering killswitch default
Browse files Browse the repository at this point in the history
  • Loading branch information
notlesh committed May 18, 2023
1 parent 0c36836 commit c9635d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/tests/test-precompile/test-precompile-wormhole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,21 @@ describeDevMoonbeam(`Test local Wormhole`, (context) => {
expectEVMResult(result.result.events, "Succeed", "Returned");
expectSubstrateEvents(result, "xTokens", "TransferredMultiAssets");
});

it("should fail with killswitch enabled by default", async function () {
// payload should be irrelevant since the precompile will fail before attempting to decode
const transferVAA = "deadbeef";

const data = GMP_INTERFACE.encodeFunctionData("wormholeTransferERC20", [`0x${transferVAA}`]);

const result = await context.createBlock(
createTransaction(context, {
to: PRECOMPILE_GMP_ADDRESS,
gas: 500_000,
data,
})
);

expectEVMResult(result.result.events, "Revert", "Reverted");
});
});

0 comments on commit c9635d0

Please sign in to comment.