Skip to content

Commit

Permalink
fixed verifyVaa
Browse files Browse the repository at this point in the history
  • Loading branch information
HamphreyR26 authored and evan-gray committed Jun 7, 2024
1 parent 3cc9acc commit e28c878
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions clients/js/src/cmds/verifyVaa.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
// The verify-vaa command invokes the parseAndVerifyVM method on the core contract on the specified EVM chain to verify the specified VAA.

import { Implementation__factory } from "@certusone/wormhole-sdk/lib/esm/ethers-contracts";
import {
import {
CONTRACTS,
CHAINS,
ChainName,
assertChain,
assertEVMChain
assertEVMChain,
} from "@certusone/wormhole-sdk/lib/esm/utils/consts";
import { ethers } from "ethers";
import yargs from "yargs";
import { NETWORKS, NETWORK_OPTIONS } from "../consts";
import { assertNetwork } from "../utils";

export const command = "verify-vaa";
export const desc = "Verifies a VAA by querying the core contract on the specified EVM chain";
export const desc =
"Verifies a VAA by querying the core contract on the specified EVM chain";
export const builder = (y: typeof yargs) =>
y
.option("vaa", {
Expand All @@ -39,7 +41,7 @@ export const builder = (y: typeof yargs) =>
describe: "RPC endpoint",
type: "string",
demandOption: false,
})
});
export const handler = async (
argv: Awaited<ReturnType<typeof builder>["argv"]>
) => {
Expand All @@ -51,7 +53,8 @@ export const handler = async (
assertNetwork(network);

const rpc = argv.rpc ?? NETWORKS[network][chain].rpc;
const contract_address = argv["contract-address"] ?? CONTRACTS[network][chain].core;
const contract_address =
argv["contract-address"] ?? CONTRACTS[network][chain].core;
if (!contract_address) {
throw Error(`Unknown core contract on ${network} for ${chain}`);
}
Expand Down

0 comments on commit e28c878

Please sign in to comment.