Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cosmwasm): support for deploying the axelarnet-gateway contract #348

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions cosmwasm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,28 @@ const makeMultisigProverInstantiateMsg = (config, chainName) => {
};
};

const makeAxelarnetGatewayInstantiateMsg = (config, chainName) => {
const {
axelar: { contracts },
} = config;
const chainConfig = getChainConfig(config, chainName);

const { axelarId: chainId } = chainConfig;
jcs47 marked this conversation as resolved.
Show resolved Hide resolved

const {
Router: { address: routerAddress },
} = contracts;

if (!validateAddress(routerAddress)) {
throw new Error('Missing or invalid Router.address in axelar info');
}

return {
router_address: routerAddress,
chain_name: chainId,
jcs47 marked this conversation as resolved.
Show resolved Hide resolved
};
};

const makeInstantiateMsg = (contractName, chainName, config) => {
const {
axelar: { contracts },
Expand Down Expand Up @@ -500,6 +522,14 @@ const makeInstantiateMsg = (contractName, chainName, config) => {

return makeMultisigProverInstantiateMsg(config, chainName);
}

case 'AxelarnetGateway': {
if (!chainConfig) {
throw new Error('AxelarnetGateway requires chainNames option');
}

return makeAxelarnetGatewayInstantiateMsg(config, chainName);
}
}

throw new Error(`${contractName} is not supported.`);
Expand Down
Loading