From 77109fa7b7a3a6bb9af689ee9fffa75cc2d20976 Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 22 Aug 2024 16:38:50 +0530 Subject: [PATCH] feat: version bump and all path fix --- scripts/deploy/helpers/send-msg/utils.ts | 2 +- scripts/rpcConfig/constants/version.ts | 2 +- .../txdata-builder/generate-calldata.ts | 89 ++++++++++--------- 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/scripts/deploy/helpers/send-msg/utils.ts b/scripts/deploy/helpers/send-msg/utils.ts index 628f7030..34dd5331 100644 --- a/scripts/deploy/helpers/send-msg/utils.ts +++ b/scripts/deploy/helpers/send-msg/utils.ts @@ -124,7 +124,7 @@ export const sendCounterBridgeMsg = async ( `fees for path ${chainSlug}-${siblingSlug} is ${formatEther(value)} ETH` ); - const { gasLimit, gasPrice, type } = overrides(chainSlug); + const { gasLimit, gasPrice, type } = await overrides(chainSlug); // console.log({to, data, value, gasLimit}); let response = await relayTx({ to, diff --git a/scripts/rpcConfig/constants/version.ts b/scripts/rpcConfig/constants/version.ts index 69d5fd32..60b25d98 100644 --- a/scripts/rpcConfig/constants/version.ts +++ b/scripts/rpcConfig/constants/version.ts @@ -2,5 +2,5 @@ import { DeploymentMode } from "../../../src"; export const version = { [DeploymentMode.DEV]: "1.0.5", - [DeploymentMode.PROD]: "1.0.41", + [DeploymentMode.PROD]: "1.0.43", }; diff --git a/scripts/rpcConfig/txdata-builder/generate-calldata.ts b/scripts/rpcConfig/txdata-builder/generate-calldata.ts index 16e27b9f..bbc9daa3 100644 --- a/scripts/rpcConfig/txdata-builder/generate-calldata.ts +++ b/scripts/rpcConfig/txdata-builder/generate-calldata.ts @@ -122,47 +122,54 @@ export const getTxData = async (): Promise => { .filter((c) => addresses[c]?.["SocketSimulator"]); const txData: TxData = {}; - for (const chainSlug of allChainSlugs) { - console.log(`Getting tx data for ${chainSlug}`); - const packetInfo = await getPacketInfo( - chainSlug, - addresses[chainSlug]?.["CapacitorSimulator"] - ); - - const sbSimulatorAddress = addresses[chainSlug]?.["SwitchboardSimulator"]; - if (sbSimulatorAddress === undefined) - throw new Error("Sb simulator not found!"); - - const sealTxData = await getSealTxData(chainSlug, signer, packetInfo); - const proposeTxData = await getProposeTxData( - chainSlug, - signer, - packetInfo, - sbSimulatorAddress - ); - const attestTxData = await getAttestTxData( - chainSlug, - signer, - packetInfo, - sbSimulatorAddress - ); - const executeTxData = await getExecuteTxData(chainSlug, signer, packetInfo); - - const simulatorContract = new Contract( - sbSimulatorAddress, - OwnableABIInterface, - getProviderFromChainSlug(chainSlug) - ); - const owner = await simulatorContract.owner(); - - txData[chainSlug] = { - sealTxData, - proposeTxData, - attestTxData, - executeTxData, - owner, - }; - } + await Promise.all( + allChainSlugs.map(async (chainSlug) => { + console.log(`Getting tx data for ${chainSlug}`); + const packetInfo = await getPacketInfo( + chainSlug, + addresses[chainSlug]?.["CapacitorSimulator"] + ); + + const sbSimulatorAddress = addresses[chainSlug]?.["SwitchboardSimulator"]; + if (sbSimulatorAddress === undefined) + throw new Error("Sb simulator not found!"); + + const sealTxData = await getSealTxData(chainSlug, signer, packetInfo); + const proposeTxData = await getProposeTxData( + chainSlug, + signer, + packetInfo, + sbSimulatorAddress + ); + const attestTxData = await getAttestTxData( + chainSlug, + signer, + packetInfo, + sbSimulatorAddress + ); + const executeTxData = await getExecuteTxData( + chainSlug, + signer, + packetInfo + ); + + const simulatorContract = new Contract( + sbSimulatorAddress, + OwnableABIInterface, + getProviderFromChainSlug(chainSlug) + ); + const owner = await simulatorContract.owner(); + + txData[chainSlug] = { + sealTxData, + proposeTxData, + attestTxData, + executeTxData, + owner, + }; + console.log(`Tx data for ${chainSlug} done`); + }) + ); return txData; };