-
Notifications
You must be signed in to change notification settings - Fork 2
Add IBC Command and Fix typo in Comet Client variable #121
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
Conversation
WalkthroughThis pull request introduces a patch to fix a bug related to the variable name of the comet client in the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
packages/andrjs/src/AndromedaClient.ts (2)
227-246
: Add input validation for IBC parameters.While the implementation is correct, consider adding validation for the input parameters:
portId
andchannelId
should be non-empty stringspacketSequence
should be a non-negative numberasync queryIbcAck(portId: string, channelId: string, packetSequence: number) { + if (!portId || !portId.trim()) { + throw new Error("portId must be a non-empty string"); + } + if (!channelId || !channelId.trim()) { + throw new Error("channelId must be a non-empty string"); + } + if (packetSequence < 0) { + throw new Error("packetSequence must be a non-negative number"); + } this.preMessage();
248-254
: Add JSDoc documentation for the decodeAck method.Consider adding comprehensive documentation to improve code maintainability:
+/** + * Decodes an IBC acknowledgement from either a base64 string or Uint8Array + * @param acknowledgement - The acknowledgement to decode (base64 string or Uint8Array) + * @returns Decoded Acknowledgement object + * @throws Error if client is not connected + */ async decodeAck(acknowledgement: Uint8Array | string) {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
.changeset/five-cobras-flow.md
(1 hunks).changeset/pre.json
(1 hunks)packages/andrjs/CHANGELOG.md
(1 hunks)packages/andrjs/package.json
(1 hunks)packages/andrjs/src/AndromedaClient.ts
(3 hunks)packages/andrjs/src/clients/ChainClient.ts
(2 hunks)packages/andrjs/src/clients/CosmClient.ts
(2 hunks)packages/cli/CHANGELOG.md
(1 hunks)packages/cli/package.json
(1 hunks)packages/cli/src/cmd.ts
(2 hunks)packages/cli/src/handlers/ibc/index.ts
(1 hunks)packages/cli/src/handlers/index.ts
(4 hunks)
✅ Files skipped from review due to trivial changes (5)
- .changeset/five-cobras-flow.md
- packages/andrjs/CHANGELOG.md
- packages/andrjs/package.json
- packages/cli/package.json
- packages/cli/CHANGELOG.md
🧰 Additional context used
🪛 Biome (1.9.4)
packages/cli/src/handlers/ibc/index.ts
[error] 30-30: isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead.
See the MDN documentation for more details.
Unsafe fix: Use Number.isNaN instead.
(lint/suspicious/noGlobalIsNan)
🔇 Additional comments (8)
.changeset/pre.json (1)
12-12
: LGTM! Verify version increments.The addition of the "five-cobras-flow" changeset for the Comet Client variable fix is appropriate.
Let's verify the version increments mentioned in the AI summary:
✅ Verification successful
✅ Version increments verified
The package versions match exactly:
- andromeda.js: 2.0.0-beta.4
- cli: 2.0.0-beta.5
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the version increments in package.json files # Check andromeda.js version echo "Checking andromeda.js version:" fd --type f "package.json" --exec grep -l "@andromedaprotocol/andromeda.js" {} \; | xargs cat # Check CLI version echo "Checking CLI version:" fd --type f "package.json" --exec grep -l "@andromedaprotocol/cli" {} \; | xargs catLength of output: 7894
packages/cli/src/handlers/index.ts (1)
11-11
: LGTM! IBC command integration looks good.The changes consistently follow the existing pattern for command registration and export.
Also applies to: 22-22, 36-36, 49-49
packages/andrjs/src/clients/ChainClient.ts (2)
36-36
: LGTM! IBC extension added correctly.The addition of
IbcExtension
to therawQueryClient
type is appropriate for supporting IBC functionality.
40-40
: LGTM! Fixed typo in property name.Corrected the property name from
commectClient
tocometClient
.packages/cli/src/cmd.ts (1)
78-84
: LGTM! IBC command integration is consistent.The IBC command follows the established pattern and includes appropriate disabled state handling.
packages/andrjs/src/AndromedaClient.ts (1)
23-25
: LGTM! IBC-related imports are properly added.The new imports are correctly scoped and necessary for implementing the IBC acknowledgment functionality.
packages/andrjs/src/clients/CosmClient.ts (2)
38-38
: LGTM! IBC extension import is properly added.The setupIbcExtension import is correctly placed alongside other setup extensions.
118-119
: LGTM! IBC extension is properly integrated.The setupIbcExtension is correctly added to the QueryClient extensions, following the established pattern.
Motivation
Summary by CodeRabbit
New Features
Bug Fixes
cometClient
variable name.Chores
@andromedaprotocol/andromeda.js
and@andromedaprotocol/cli
.