docs(client): add godoc to ChainClientV2 core methods#352
docs(client): add godoc to ChainClientV2 core methods#352ahwlsqja wants to merge 2 commits intoInjectiveLabs:masterfrom
Conversation
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".
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📝 WalkthroughWalkthroughThe ChainClientV2 interface in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
Summary
Add godoc documentation to the
ChainClientV2interface inclient/chain/chain_v2.go, focusing on the most commonly used methods:CanSignTransactions,FromAddress,QueryClient,ClientContext,GetAccNonceSimulateMsg,AsyncBroadcastMsg,SyncBroadcastMsg,BuildSignedTxGetGasFee,GetTx,GetNetwork,CloseAlso fixes "IBC Core Chain module" section header to "IBC Core Client module" (the section wraps
ibcclienttypes, notibcchaintypes).All changes are documentation only — zero runtime behavior change.
Related: #349
Verification
go build ./client/...✓go vet ./client/...✓Summary by CodeRabbit