-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: add coin-type and key-type when generate key #157
Conversation
WalkthroughThe changes involve updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant F as Key Function
participant EC as exec.Command
participant OS as Shell
F->>EC: Build command with keyname, test backend, json output
alt isCelestia true
EC->>OS: Execute command with --coin-type 118, --key-type secp256k1
else isCelestia false
EC->>OS: Execute command with --coin-type 118, --key-type secp256k1
end
Poem
🪧 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
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (2)
cosmosutils/binary_test.go (1)
64-69
: Accurate test of release vs pre-release handling.Verifying that “1.0.0” is considered greater than “1.0.0-beta.1” aligns with the updated CompareSemVer logic. Well done.
If time permits, consider expanding coverage to numeric comparisons such as “alpha.10” vs “alpha.2” to ensure the comparison logic properly handles multi-digit pre-release parts.
cosmosutils/binary.go (1)
246-289
: Naming improvement recommended for clarity in pre-release parsing.Overall, the new pre-release logic and final equality check are aligned with standard semantic versioning behavior. However, the variables named
v1IsInt
andv2IsInt
in lines near 268-279 can be confusing when they actually hold parsing errors. Consider renaming them tov1Err
andv2Err
(or similar) to reflect their usage as error objects, improving readability.Below is a sample diff to rename the variables for clarity:
- v1Int, v1IsInt := strconv.Atoi(v1PreParts[i]) - v2Int, v2IsInt := strconv.Atoi(v2PreParts[i]) - if v1IsInt == nil && v2IsInt == nil { + v1Int, v1Err := strconv.Atoi(v1PreParts[i]) + v2Int, v2Err := strconv.Atoi(v2PreParts[i]) + if v1Err == nil && v2Err == nil {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Lite
📒 Files selected for processing (2)
cosmosutils/binary.go
(2 hunks)cosmosutils/binary_test.go
(1 hunks)
🔇 Additional comments (4)
cosmosutils/binary_test.go (3)
47-51
: Good addition of complex prerelease test scenario.These lines effectively verify a numeric pre-release component (e.g., alpha.2) is considered greater than a lower numeric pre-release component (alpha.1). This matches typical semantic versioning rules and helps ensure correct comparison behavior.
53-57
: Reverse prerelease test scenario is well-handled.This complementary test confirms that alpha.1 is lesser than alpha.2, which returns false in the comparison. No issues here.
58-63
: Excellent coverage for different prerelease identifiers.Testing “beta.1” vs “alpha.2” broadens coverage of string comparison rules in pre-release identifiers, confirming correct ordering. Looks good.
cosmosutils/binary.go (1)
219-225
: Clear and concise documentation updates.The added examples address both normal and pre-release comparisons, providing a quick reference for expected behaviors. This clarity is valuable for maintainers and contributors alike.
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.
LGTM
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit