-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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(epochs): add wrapper of epoch getter #22068
Conversation
📝 Walkthrough📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request focus on enhancing the documentation and functionality of the Changes
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
ed386fa
to
914ae57
Compare
@julienrbrt This is the PR of adding simple wrapper for epoch getter. |
914ae57
to
23805df
Compare
23805df
to
3cca8e7
Compare
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.
ACK, thank you!
3cca8e7
to
8000432
Compare
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
🧹 Outside diff range and nitpick comments (1)
x/epochs/keeper/epoch.go (1)
11-14
: LGTM: TheGetEpochInfo
function is well-implemented.The function signature and implementation are correct and align with the PR objectives. It follows Go conventions and the Uber Go Style Guide.
Consider adding a check for an empty identifier and returning a meaningful error in that case:
func (k Keeper) GetEpochInfo(ctx sdk.Context, identifier string) (types.EpochInfo, error) { if identifier == "" { return types.EpochInfo{}, fmt.Errorf("empty identifier provided") } return k.EpochInfo.Get(ctx, identifier) }This would improve error handling and make the function more robust.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
📥 Commits
Files that changed from the base of the PR and between 947ffe0 and 8000432f0a25a34c7d9d0a9004a200f23eb764a1.
📒 Files selected for processing (2)
- x/epochs/README.md (0 hunks)
- x/epochs/keeper/epoch.go (1 hunks)
💤 Files with no reviewable changes (1)
- x/epochs/README.md
🧰 Additional context used
📓 Path-based instructions (1)
x/epochs/keeper/epoch.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
🔇 Additional comments (1)
x/epochs/keeper/epoch.go (1)
6-6
: LGTM: Import statement is correct and necessary.The import of the
sdk
package is required for the newGetEpochInfo
function and follows the Uber Go Style Guide for third-party package imports.
Could you run |
8000432
to
b648983
Compare
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
🧹 Outside diff range and nitpick comments (2)
tests/integration/tx/internal/util.go (2)
Line range hint
134-139
: LGTM: Improved message name retrieval.The change to use
gogoproto.MessageName(msg)
is a good improvement. It provides a more standard and reliable way to get the full name of a protobuf message, especially when dealing with gogo/protobuf messages.Consider adding a comment explaining why this change was made, to provide context for future maintainers.
// Use gogoproto.MessageName to ensure compatibility with gogo/protobuf messages typeName := gogoproto.MessageName(msg)
Line range hint
141-151
: LGTM: Consistent use of gogoproto for marshaling.The change to use
gogoproto.Marshal(msg)
is consistent with the previous change and improves compatibility with gogo/protobuf messages. The existing comment provides good context for the method's purpose.For consistency with the
MessageDescriptor
method, consider adding a brief comment explaining the use ofgogoproto.Marshal
.// Use gogoproto.Marshal to ensure compatibility with gogo/protobuf messages protoBz, err := gogoproto.Marshal(msg)
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
📒 Files selected for processing (3)
- tests/integration/tx/context_test.go (1 hunks)
- tests/integration/tx/internal/util.go (1 hunks)
- x/epochs/keeper/epoch.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/integration/tx/context_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
- x/epochs/keeper/epoch.go
🧰 Additional context used
📓 Path-based instructions (1)
tests/integration/tx/internal/util.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
tests/**/*
: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"
🔇 Additional comments (2)
tests/integration/tx/internal/util.go (2)
9-9
: LGTM: Import statement added correctly.The addition of the
gogoproto
import is appropriate and follows Go conventions. This import is necessary for the changes made in theMessageDescriptor
andDynamicMessage
methods.
Line range hint
1-232
: Overall assessment: Improved protobuf compatibility in test utilities.The changes in this file enhance the test utilities to work more effectively with gogo/protobuf messages. The consistent use of
gogoproto
for message name retrieval and marshaling improves compatibility and reliability when dealing with protobuf messages in tests.These modifications align well with the PR objectives and contribute to a more robust testing framework for the epoch information retrieval functionality.
(cherry picked from commit dc14960)
Description
Closes: #22041
Added simple wrapper for getting epoch info by identifier in
epochs
module.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 changeCHANGELOG.md
Reviewers 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.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
Documentation
x/epochs
module documentation, clarifying functionality and structure.New Features