From f837a1f426808f406070fce1e1ed2f8c80b62e68 Mon Sep 17 00:00:00 2001 From: eguajardo Date: Mon, 23 Dec 2024 21:32:31 -0600 Subject: [PATCH] fix(cosmwasm): prevent contract config initialization when no contract name is required for the script (#486) --- cosmwasm/submit-proposal.js | 2 +- cosmwasm/utils.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cosmwasm/submit-proposal.js b/cosmwasm/submit-proposal.js index 441b86d5..d1ce889f 100644 --- a/cosmwasm/submit-proposal.js +++ b/cosmwasm/submit-proposal.js @@ -295,7 +295,7 @@ const programHandler = () => { options.chains = chains; mainProcessor(registerItsChain, options); }); - addAmplifierOptions(registerItsChainCmd, { registerItsChainOptions: true, proposalOptions: true, runAs: true }); + addAmplifierOptions(registerItsChainCmd, { proposalOptions: true, runAs: true }); const paramChangeCmd = program .command('paramChange') diff --git a/cosmwasm/utils.js b/cosmwasm/utils.js index 787feb39..db908848 100644 --- a/cosmwasm/utils.js +++ b/cosmwasm/utils.js @@ -66,6 +66,10 @@ const getLabel = ({ contractName, label }) => label || contractName; const readWasmFile = ({ artifactPath, contractName }) => readFileSync(`${artifactPath}/${pascalToSnake(contractName)}.wasm`); const initContractConfig = (config, { contractName, chainName }) => { + if (!contractName) { + return; + } + config.axelar = config.axelar || {}; config.axelar.contracts = config.axelar.contracts || {}; config.axelar.contracts[contractName] = config.axelar.contracts[contractName] || {};