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

Allow flexible CLI argument positioning of Starknet and Cosmos chain arguments #198

Open
Tracked by #123
soareschen opened this issue Jan 14, 2025 · 0 comments
Open
Tracked by #123
Assignees
Labels
Milestone

Comments

@soareschen
Copy link
Collaborator

Due to the static-typed design of Hermes SDK, we currently hard code the chain type positions, with the StarknetChain always being the first/target chain, and CosmosChain being the second/counterparty chain. The consequence is the commands like query client state can only be called on the Starknet chain, but not on the Cosmos chain.

There are ways to use CGP to generalize the chain types, such as having a StarknetOrCosmosChain wrapper context. However, the current time constraint for the MVP makes it challenging to implement such full generalization without risk of delay.

As an alternative, we would build three separate CLI contexts to support the two positions. The second CLI context would have Cosmos chain as the first chain and Starknet chain as the second chain. The third CLI context would act as a dispatcher, by first determining from the config which chain type is in the first and second position of the CLI.

Note that this approach will require quite a bit of boilerplate to implement the second and third CLI contexts. But we will only able to revisit the code and reunify the commands under a single CLI implementation after the MVP is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant