Skip to content

Commit

Permalink
CLI: Fix verify-vaa and Sui submit for testnet (#4204)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley authored Dec 19, 2024
1 parent 79657d4 commit 1dbe845
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clients/js/src/chains/sui/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
9 changes: 7 additions & 2 deletions clients/js/src/cmds/verifyVaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1dbe845

Please sign in to comment.