InjectiveLabs / sdk-go

Tools to work with the Injective Chain, Injective EVM and EIP712.
Apache License 2.0
95 stars 41 forks source link

feat/ibc_connection_module_queries #219

Closed aarmoa closed 6 months ago

aarmoa commented 6 months ago

Solves CHAIN-84

Summary by CodeRabbit

coderabbitai[bot] commented 6 months ago

Walkthrough

The recent updates enhance the ChainClient in the chain.go file by introducing new functions for IBC Core Connection interactions. Additionally, a series of example programs have been added, demonstrating various IBC connection queries using the InjectiveLabs SDK. These changes improve the SDK's capabilities in managing and displaying IBC connection data.

Changes

Files Changes
client/chain/chain.go
client/chain/chain_test_support.go
Added new IBC connection-related functions; reorganized and adjusted import statements.
examples/chain/ibc/connection/query/... Introduced Go programs for querying different aspects of IBC connections, including single connections, all connections, client connections, and specific states using InjectiveLabs SDK.

Poem

🐇💻🌟
In the garden of code, where the data vines twirl,
A rabbit hopped in, with each whisker a swirl.
"To connect every node," it said with a beam,
"Through the magic of IBC, a developer's dream!"
So it danced in the bytes, under moon's gentle light,
Crafting connections, making all networks unite.
🌍🔗🌟


Recent Review Details **Configuration used: .coderabbit.yaml** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 31417bcf38eacd63765afa498ef6fc2411b06d9d and 01e7ce114fb731856132390963cb3fdf1a99f39c.
Files selected for processing (8) * client/chain/chain.go (5 hunks) * client/chain/chain_test_support.go (3 hunks) * examples/chain/ibc/connection/query/1_Connection/example.go (1 hunks) * examples/chain/ibc/connection/query/2_Connections/example.go (1 hunks) * examples/chain/ibc/connection/query/3_ClientConnections/example.go (1 hunks) * examples/chain/ibc/connection/query/4_ConnectionClientState/example.go (1 hunks) * examples/chain/ibc/connection/query/5_ConnectionConsensusState/example.go (1 hunks) * examples/chain/ibc/connection/query/6_ConnectionParams/example.go (1 hunks)
Additional comments not posted (5)
client/chain/chain_test_support.go (1)
`694-717`: Review the implementation of new IBC Core Connection module functions. The new functions for the IBC Core Connection module have been correctly implemented as mock functions returning empty responses. This is appropriate for unit testing scenarios where the actual functionality is not required.
client/chain/chain.go (4)
`284-290`: Ensure proper error handling and context propagation in new IBC connection methods. Please verify that all new methods properly handle errors and propagate context to ensure robustness and maintainability. --- `317-331`: Initialization of query clients in `chainClient` struct. Initialization of various query clients within the `chainClient` struct is done correctly, ensuring that each module can perform its respective queries effectively. --- `417-431`: Proper setup of query clients during `chainClient` construction. The setup of query clients during the construction of `chainClient` is handled properly, which is crucial for the functionality of the client methods that depend on these clients. --- `2581-2633`: Addition of new IBC Core Connection module methods. The addition of new methods related to the IBC Core Connection module in the `chainClient` struct is implemented correctly. These methods extend the client's capabilities to interact with IBC connections effectively.
---
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 21.73913% with 54 lines in your changes are missing coverage. Please review.

Project coverage is 20.97%. Comparing base (8181fd2) to head (01e7ce1). Report is 10 commits behind head on dev.

Files Patch % Lines
client/chain/chain.go 26.31% 42 Missing :warning:
client/chain/chain_test_support.go 0.00% 12 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #219 +/- ## ========================================== - Coverage 24.67% 20.97% -3.71% ========================================== Files 17 18 +1 Lines 3068 3614 +546 ========================================== + Hits 757 758 +1 - Misses 2279 2828 +549 + Partials 32 28 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.