Skip to content

Commit

Permalink
fix(cosmwasm): persist code id when predicting contract address (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth authored Jul 31, 2024
1 parent 71c829b commit 35df60a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cosmwasm/submit-proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 35df60a

Please sign in to comment.