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;