You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When one tries to run npm run execute in axelar-examples with parent chain being more than one word like Arbitrum-Sepolia, Optimism-Sepolia, axelarjs-sdk, etc throws type error
/home/wsl-ubuntu/blockchain/axelar/axelar-examples/node_modules/@axelar-network/axelarjs-sdk/dist/src/utils/validateChain.js:21
const foundChain = chainIdentifiers.find((identifier) => identifier === chainIdentifier.toLowerCase());
^
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at /home/wsl-ubuntu/blockchain/axelar/axelar-examples/node_modules/@axelar-network/axelarjs-sdk/dist/src/utils/validateChain.js:21:97
at Array.find (<anonymous>)
at /home/wsl-ubuntu/blockchain/axelar/axelar-examples/node_modules/@axelar-network/axelarjs-sdk/dist/src/utils/validateChain.js:21:45
at Generator.next (<anonymous>)
at fulfilled (/home/wsl-ubuntu/blockchain/axelar/axelar-examples/node_modules/@axelar-network/axelarjs-sdk/dist/src/utils/validateChain.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The issue here is that chains in our sdk supported-chain-list has _ in between two words while on sending multiple word chain as parent we have - in between two words leading mismatch and hence the Chain being undefined going into the calculateGasFee() or any other solution.
To Reproduce
Steps to reproduce the behavior:
Clone axelar-examples and build the contracts as per readme instructions
Deploy any contract lets say evm/call-contract once on multiple word chain like Arbitrum-Sepolia, Optimism-Sepolia, etc and then other on any other chain.
Remove the defaulting of sourceChain to arbitrum otherwise it defaults to their instead of any other chain.
Run npm run execute taking multiple word chain as parent and any other as child.
See error
Expected behavior
Ideally transaction should run successfully
Screenshots
Possible Solution
Change name of supported chain to have - instead of _ in axelar-js-sdk
Handle the case in utils.js but I guess same error may occur in other places like execute() as well.
I think we will have to come up with better solution for multi word chain mapping between our chain-config and supported-chain mapping in js-sdk.
Desktop (please complete the following information):
OS: Windows WSL
Additional context
Blocks devs starting to using axelar, should be resolved soon.
The text was updated successfully, but these errors were encountered:
lordshashank
changed the title
execute failing for mutiple worded chainsexecute failing for multiple worded chains
Aug 6, 2024
Hi @lordshashank. Can you confirm you deployed the contracts without any issue on testnet? I just ran a testnet transaction for Base Sepolia (a multi worded chain) and it worked fine.
See here
❯ npm run execute evm/call-contract testnet "Base-Sepolia" "Avalanche" "Hello World"
> [email protected] execute
> node scripts/runExecute evm/call-contract testnet Base-Sepolia Avalanche Hello World
--- Initially ---
value at Avalanche is ""
You can track the GMP transaction status on https://testnet.axelarscan.io/gmp/0x124b254eeea59eb15decb3f9c1d93430fee02b1eb1706b3b50be723fea71dc07
--- After ---
value at Avalanche is "Hello World"
Describe the bug
When one tries to run
npm run execute
in axelar-examples with parent chain being more than one word likeArbitrum-Sepolia
,Optimism-Sepolia
, axelarjs-sdk, etc throws type errorThe issue here is that chains in our sdk supported-chain-list has
_
in between two words while on sending multiple word chain as parent we have-
in between two words leading mismatch and hence the Chain being undefined going into thecalculateGasFee()
or any other solution.To Reproduce
Steps to reproduce the behavior:
evm/call-contract
once on multiple word chain likeArbitrum-Sepolia
,Optimism-Sepolia
, etc and then other on any other chain.npm run execute
taking multiple word chain as parent and any other as child.Expected behavior
Ideally transaction should run successfully
Screenshots
Possible Solution
-
instead of_
in axelar-js-sdkutils.js
but I guess same error may occur in other places likeexecute()
as well.I think we will have to come up with better solution for multi word chain mapping between our chain-config and supported-chain mapping in js-sdk.
Desktop (please complete the following information):
Additional context
Blocks devs starting to using axelar, should be resolved soon.
The text was updated successfully, but these errors were encountered: