Skip to content

docs(client): add godoc to ChainClientV2 core methods#352

Open
ahwlsqja wants to merge 2 commits intoInjectiveLabs:masterfrom
ahwlsqja:docs/add-chainclientv2-godoc-v2
Open

docs(client): add godoc to ChainClientV2 core methods#352
ahwlsqja wants to merge 2 commits intoInjectiveLabs:masterfrom
ahwlsqja:docs/add-chainclientv2-godoc-v2

Conversation

@ahwlsqja
Copy link

@ahwlsqja ahwlsqja commented Feb 16, 2026

Summary

Add godoc documentation to the ChainClientV2 interface in client/chain/chain_v2.go, focusing on the most commonly used methods:

  • Type-level godoc describing purpose, construction pattern, and module coverage
  • Lifecycle methods: CanSignTransactions, FromAddress, QueryClient, ClientContext, GetAccNonce
  • Transaction broadcasting: SimulateMsg, AsyncBroadcastMsg, SyncBroadcastMsg, BuildSignedTx
  • Utilities: GetGasFee, GetTx, GetNetwork, Close

Also fixes "IBC Core Chain module" section header to "IBC Core Client module" (the section wraps ibcclienttypes, not ibcchaintypes).

All changes are documentation only — zero runtime behavior change.

Related: #349

Verification

  • go build ./client/...
  • go vet ./client/...

Summary by CodeRabbit

  • New Features
    • Expanded chain client interface with three new methods: GetGasFee() for retrieving current gas fee information, GetNetwork() for accessing network configuration details, and Close() for enabling proper resource cleanup and lifecycle management.

Add godoc comments to ChainClientV2 interface focusing on the most
commonly used methods: lifecycle (CanSignTransactions, FromAddress,
QueryClient, ClientContext), transaction broadcasting (SimulateMsg,
AsyncBroadcastMsg, SyncBroadcastMsg, BuildSignedTx), and utilities
(GetGasFee, GetTx, GetNetwork, Close).

Also adds a type-level godoc describing the interface purpose and
fixes "IBC Core Chain module" section header to "IBC Core Client module".
@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Warning

Rate limit exceeded

@ahwlsqja has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

The ChainClientV2 interface in client/chain/chain_v2.go is expanded with three new exported methods: GetGasFee(), GetNetwork(), and Close(). These additions provide gas fee retrieval, network configuration exposure, and resource cleanup capabilities. Minor documentation updates accompany the changes.

Changes

Cohort / File(s) Summary
ChainClientV2 Interface Expansion
client/chain/chain_v2.go
Added three new methods to the ChainClientV2 interface: GetGasFee() (string, error) for transaction diagnostics, GetNetwork() common.Network for network configuration access, and Close() for lifecycle management. Minor doc comment adjustments included.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Three new methods hop into view,
GetGasFee whispers what chains must do,
GetNetwork reveals the path we take,
Close shuts the door for cleanups' sake! 🌱

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs(client): add godoc to ChainClientV2 core methods' accurately reflects the main objective: adding godoc documentation to ChainClientV2 methods.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@client/chain/chain_v2.go`:
- Around line 82-83: The BuildSignedTx comment wrongly refers to a non-existent
simulate parameter; update the docstring for BuildSignedTx to reference the
actual control flag c.ctx.Simulate instead of "simulate" and clarify behavior:
state that when c.ctx.Simulate is false the provided initialGas is used directly
(and when true gas is estimated via simulation). Ensure the revised comment
mentions BuildSignedTx, c.ctx.Simulate, and initialGas so readers can locate the
logic.
- Around line 54-60: The top-of-file comment for ChainClientV2 incorrectly
references the constructor as NewChainClient; update the doc comment to
reference the correct constructor NewChainClientV2 and ensure any surrounding
descriptive text still reads correctly; locate the comment block that documents
ChainClientV2 (the block that currently says "Create instances using
NewChainClient") and replace that mention with "Create instances using
NewChainClientV2".
- Line 271: Update the implementation section comment that still reads "IBC Core
Chain module" to match the interface comment and use "IBC Core Client module";
locate the implementation comment string in chain_v2.go (the implementation
section comment near the existing interface comment for the IBC client) and
change its text from "IBC Core Chain module" to "IBC Core Client module" so both
comments are consistent.
- Around line 126-127: The change added GetGasFee(), GetNetwork(), and Close()
to the ChainClientV2 interface which is a breaking API change for external
implementors; instead, revert those three methods from ChainClientV2 and create
a new interface (e.g., ChainClientV3) that embeds ChainClientV2 and declares
GetGasFee(), GetNetwork(), and Close(); then update internal code that needs the
new methods to accept ChainClientV3, update the internal MockChainClientV2/test
mocks to either implement ChainClientV3 or add a separate MockChainClientV3, and
update callers/imports accordingly so external consumers keeping ChainClientV2
unchanged are not forced to change their mocks.

- Fix constructor reference: NewChainClient → NewChainClientV2
- Fix BuildSignedTx comment: remove reference to nonexistent simulate parameter
- Fix implementation section comment: IBC Core Chain → IBC Core Client module
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

Successfully merging this pull request may close these issues.

1 participant