feat: support axelarnet proposals#1322
Conversation
| }; | ||
|
|
||
| const encodeAddIBCChain = (options) => { | ||
| const { cosmosChain, addrPrefix, ibcPath } = options; |
There was a problem hiding this comment.
Array passed to function expecting object destructuring
The encodeAddIBCChain function uses object destructuring ({ cosmosChain, addrPrefix, ibcPath } = options) but receives an array from the caller addIBCChain which passes args directly. When object destructuring is applied to an array like ['chain1', 'prefix1', 'path1'], all named properties will be undefined since arrays have numeric indices, not named properties. This will cause the feature to fail at the validateParameters check.
Additional Locations (1)
| ) => nexusChainState('deactivate', client, config, options, args, fee); | ||
|
|
||
| const addIBCChain = (client: ClientManager, config: ConfigManager, options: CoreCommandOptions, args: string[], fee?: string | StdFee) => | ||
| executeCoreOperation(client, config, options, [encodeAddIBCChain(args)], fee); |
There was a problem hiding this comment.
Missing default title causes required option error
The addIBCChain function calls executeCoreOperation without providing a defaultTitle parameter. In executeCoreOperation, the title defaults to options.title || defaultTitle, and validation requires a non-empty string. Unlike nexusChainState which generates a default title like `${actionText} ${args.join(', ')} on Nexus`, addIBCChain will cause validation to fail if users don't explicitly provide --title and --description options. This creates inconsistent behavior compared to the activate-chain and deactivate-chain commands.
| .argument('<chainName>', 'chain name to add') | ||
| .argument('<chainPrefix>', 'chain prefix to add') | ||
| .argument('<ibcPath>', 'IBC path to add') |
There was a problem hiding this comment.
match the args match the function parameter names?
| .argument('<chainName>', 'chain name to add') | |
| .argument('<chainPrefix>', 'chain prefix to add') | |
| .argument('<ibcPath>', 'IBC path to add') | |
| .argument('<cosmosChain>', 'cosmos chain name to add') | |
| .argument('<addrPrefix>', 'address prefix') | |
| .argument('<ibcPath>', 'IBC path') |
why
how
Note
Introduces governance-driven support to add IBC chains through axelarnet.
cosmwasm/proto/axelarnet_add_chain.protodefiningAddCosmosBasedChainRequestand related typesgetAxelarnetProtoTypeandencodeAddIBCChain(options)incosmwasm/utils.js; validates inputs and returns/axelar.axelarnet.v1beta1.AddCosmosBasedChainRequestadd-ibc-chainincosmwasm/core.ts(args:chainName,chainPrefix,ibcPath) using existing governance proposal flowutils.jsand integrates withexecuteCoreOperationWritten by Cursor Bugbot for commit 899783a. This will update automatically on new commits. Configure here.