-
Notifications
You must be signed in to change notification settings - Fork 580
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
chore: Rework Denoms.Sort() to sort by base denom and then trace #6493
Conversation
WalkthroughThe changes primarily focus on modifying the sorting mechanism for Changes
Sequence Diagram(s) (Beta)Changes are too simple and varied for a meaningful sequence diagram. Assessment against linked issues
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 1
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- modules/apps/transfer/keeper/migrations_test.go (1 hunks)
- modules/apps/transfer/types/denom.go (1 hunks)
- modules/apps/transfer/types/denom_test.go (1 hunks)
Additional context used
Path-based instructions (3)
modules/apps/transfer/types/denom.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.modules/apps/transfer/types/denom_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"modules/apps/transfer/keeper/migrations_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"
golangci-lint
modules/apps/transfer/types/denom.go
100-100: undefined: Denom (typecheck)
15-15: undefined: Trace (typecheck)
23-23: undefined: Denom (typecheck)
42-42: undefined: Denom (typecheck)
49-49: undefined: Denom (typecheck)
60-60: undefined: Denom (typecheck)
75-75: undefined: Denom (typecheck)
81-81: undefined: Denom (typecheck)
88-88: undefined: Denom (typecheck)
16-16: undefined: Denom (typecheck)
27-27: undefined: ErrInvalidDenomForTransfer (typecheck)
54-54: undefined: DenomPrefix (typecheck)
Additional comments not posted (2)
modules/apps/transfer/types/denom_test.go (1)
122-261
: TheTestSort
method provides comprehensive coverage for the new sorting logic.Ensure that all edge cases are considered, especially with complex trace structures.
modules/apps/transfer/keeper/migrations_test.go (1)
123-123
: The order ofNewDenom
entries inTestMigratorMigrateDenomTraceToDenom
has been adjusted to reflect the new sorting logic.This change aligns with the PR's objective to sort denoms by base denom first and then by trace.
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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- modules/apps/transfer/types/denom.go (1 hunks)
Additional context used
Path-based instructions (1)
modules/apps/transfer/types/denom.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
golangci-lint
modules/apps/transfer/types/denom.go
100-100: undefined: Denom (typecheck)
15-15: undefined: Trace (typecheck)
23-23: undefined: Denom (typecheck)
42-42: undefined: Denom (typecheck)
49-49: undefined: Denom (typecheck)
60-60: undefined: Denom (typecheck)
75-75: undefined: Denom (typecheck)
81-81: undefined: Denom (typecheck)
88-88: undefined: Denom (typecheck)
16-16: undefined: Denom (typecheck)
27-27: undefined: ErrInvalidDenomForTransfer (typecheck)
54-54: undefined: DenomPrefix (typecheck)
Additional comments not posted (1)
modules/apps/transfer/types/denom.go (1)
125-135
: The updated sorting logic inDenoms.Less
method looks correct and aligns with the PR objectives.
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.
beautiful, thanks so much @neitdung!
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.
Thanks, @neitdung. Nice work with the tests!
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.
Excellent! Thank you @neitdung 🙏
Description
Denoms.Less()
to sort by base denom and then traceDenoms.Sort()
Denoms.Sort()
closes: #6451
Commit Message / Changelog Entry
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.Summary by CodeRabbit
Bug Fixes
Refactor
Tests