From 1dbe8459b96e182932d0dd5ae4b6bbce6f48cb09 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:18:23 -0600 Subject: [PATCH] CLI: Fix verify-vaa and Sui submit for testnet (#4204) --- clients/js/src/chains/sui/utils.ts | 2 +- clients/js/src/cmds/verifyVaa.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clients/js/src/chains/sui/utils.ts b/clients/js/src/chains/sui/utils.ts index 79f533873d..7944d9270f 100644 --- a/clients/js/src/chains/sui/utils.ts +++ b/clients/js/src/chains/sui/utils.ts @@ -416,7 +416,7 @@ export const setMaxGasBudgetDevnet = ( network: Network, tx: TransactionBlock ) => { - if (network === "Devnet") { + if (network === "Devnet" || network === "Testnet") { // Avoid Error checking transaction input objects: GasBudgetTooHigh { gas_budget: 50000000000, max_budget: 10000000000 } tx.setGasBudget(10000000000); } diff --git a/clients/js/src/cmds/verifyVaa.ts b/clients/js/src/cmds/verifyVaa.ts index 21265c6be6..fce28cf4d9 100644 --- a/clients/js/src/cmds/verifyVaa.ts +++ b/clients/js/src/cmds/verifyVaa.ts @@ -24,13 +24,18 @@ export const handler = async ( const network = getNetwork(argv.network); const buf = Buffer.from(String(argv.vaa), "hex"); - const contract_address = contracts.coreBridge(network, "Ethereum"); + const contract_address = + network === "Testnet" + ? contracts.coreBridge(network, "Sepolia") + : contracts.coreBridge(network, "Ethereum"); if (!contract_address) { throw Error(`Unknown core contract on ${network} for ethereum`); } const provider = new ethers.providers.JsonRpcProvider( - NETWORKS[network].Ethereum.rpc + network === "Testnet" + ? NETWORKS[network].Sepolia.rpc + : NETWORKS[network].Ethereum.rpc ); const contract = Implementation__factory.connect(contract_address, provider); const result = await contract.parseAndVerifyVM(buf);