From 791b7e2e5eba6db8ae4de1d80071dfb01342803d Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Tue, 30 Jul 2024 15:46:38 -0400 Subject: [PATCH] fix(cosmwasm): persist code id when predicting contract address --- cosmwasm/submit-proposal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cosmwasm/submit-proposal.js b/cosmwasm/submit-proposal.js index e6a42b7b..ccbd21ac 100644 --- a/cosmwasm/submit-proposal.js +++ b/cosmwasm/submit-proposal.js @@ -121,16 +121,16 @@ const instantiate = async (client, wallet, config, options, chainName) => { chains: { [chainName]: chainConfig }, } = config; - if (predictOnly) { - return predictAndUpdateAddress(client, contractConfig, chainConfig, options, contractName, chainName); - } - if (fetchCodeId) { contractConfig.codeId = await fetchCodeIdFromCodeHash(client, contractConfig); } else if (!isNumber(contractConfig.codeId)) { throw new Error('Code Id is not defined'); } + if (predictOnly) { + return predictAndUpdateAddress(client, contractConfig, chainConfig, options, contractName, chainName); + } + const initMsg = makeInstantiateMsg(contractName, chainName, config); let proposal;