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

execute failing for multiple worded chains #197

Open
lordshashank opened this issue Aug 6, 2024 · 1 comment
Open

execute failing for multiple worded chains #197

lordshashank opened this issue Aug 6, 2024 · 1 comment
Assignees

Comments

@lordshashank
Copy link

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:

  1. Clone axelar-examples and build the contracts as per readme instructions
  2. 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.
  3. Remove the defaulting of sourceChain to arbitrum otherwise it defaults to their instead of any other chain.
  4. Run npm run execute taking multiple word chain as parent and any other as child.
  5. See error

Expected behavior
Ideally transaction should run successfully

Screenshots
image

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.

@lordshashank lordshashank changed the title execute failing for mutiple worded chains execute failing for multiple worded chains Aug 6, 2024
@benjamin852
Copy link
Contributor

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"

@benjamin852 benjamin852 self-assigned this Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants