-
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
chore: api cleanups #19541
chore: api cleanups #19541
Conversation
WalkthroughThe recent updates aim to enhance the codebase by removing deprecated functions related to public key conversions, refining module handling using Changes
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yml
Files selected for processing (5)
- crypto/codec/cmt.go (1 hunks)
- types/module/module.go (5 hunks)
- types/module/module_int_test.go (3 hunks)
- x/staking/module.go (1 hunks)
- x/staking/types/validator.go (1 hunks)
Additional comments: 7
types/module/module_int_test.go (1)
- 21-21: The update to use
appmodule.AppModule
instead ofinterface{}
for theModules
field in theManager
struct enhances type safety and clarity. This ensures that only modules implementing theAppModule
interface can be added, aligning with the Cosmos SDK's module system design goals.Also applies to: 46-46
x/staking/module.go (1)
- 171-171: The update to the
EndBlock
function, indicating it can return validator updates, is a logical and necessary change. This aligns with the Cosmos SDK's expectations for module behavior and enhances the staking module's functionality.x/staking/types/validator.go (1)
- 473-478: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]
The introduction of
CmtConsPublicKey
and the deprecation ofTmConsPublicKey
represent a positive shift towards standardization in handling consensus public keys within the Cosmos SDK. This change enhances clarity and interoperability between the Cosmos SDK and CometBFT ecosystems.types/module/module.go (4)
- 139-139: The update to the
Manager
struct to useappmodule.AppModule
instead ofinterface{}
for theModules
map is a positive change. It enhances type safety and clarity in the module management system.- 152-152: The
NewManager
function correctly initializes aManager
withappmodule.AppModule
types, ensuring consistency with the updatedManager
struct. This change improves type safety and module management.- 182-182: Similarly, the
NewManagerFromMap
function's adaptation to useappmodule.AppModule
for its map parameter aligns with theManager
struct's changes, promoting type safety and clarity in module management.- 766-766: The simplification in the
EndBlock
method by directly appendingmoduleValUpdates
tovalidatorUpdates
is a logical improvement. It streamlines the process of collecting validator updates from modules, making the code more readable and efficient.
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yml
Files selected for processing (4)
- CHANGELOG.md (1 hunks)
- runtime/services/autocli.go (2 hunks)
- testutil/mock/types_module_module.go (1 hunks)
- x/staking/types/validator.go (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- x/staking/types/validator.go
Additional comments: 4
runtime/services/autocli.go (2)
- 28-28: The change in the
NewAutoCLIQueryService
function'sappModules
parameter type frommap[string]interface{}
tomap[string]appmodule.AppModule
enhances type safety and clarity, aligning with the PR's objectives.- 39-39: The modification in the
ExtractAutoCLIOptions
function'sappModules
parameter type frommap[string]interface{}
tomap[string]appmodule.AppModule
is consistent with the PR's goal of refining type usage for better clarity and type safety.testutil/mock/types_module_module.go (1)
- 22-93: The addition of the
MockAppModuleBasic
struct and its methods for mocking theAppModuleBasic
interface, includingName
,RegisterGRPCGatewayRoutes
,RegisterInterfaces
, andRegisterLegacyAminoCodec
, is a valuable enhancement for testing. It allows for more comprehensive and isolated testing of modules that depend onAppModuleBasic
without needing to instantiate the actual implementations.CHANGELOG.md (1)
- 150-150: The change log entry is clear and accurately reflects the changes made in the
crypto
module as part of PR chore: api cleanups #19541. It follows the established format and provides the necessary details for understanding the impact of the changes.
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yml
Files selected for processing (1)
- types/module/simulation.go (2 hunks)
Additional comments: 2
types/module/simulation.go (2)
- 9-9: The addition of the
cosmossdk.io/core/appmodule
import statement is necessary for the updated function signature inNewSimulationManagerFromAppModules
. This change aligns with the PR's objective of refining type usage and simplifying logic.- 65-65: The function signature of
NewSimulationManagerFromAppModules
has been updated to usemap[string]appmodule.AppModule
instead ofmap[string]interface{}
. This change enhances type safety and clarity, which is in line with the PR's objectives of enhancing type usage and simplifying logic. However, it's important to ensure that all calls to this function throughout the codebase have been updated to match the new signature to avoid runtime errors.
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yml
Files selected for processing (1)
- types/module/module_int_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- types/module/module_int_test.go
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 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.
I have...
Summary by CodeRabbit
CHANGELOG.md
file to reflect the removal and replacement of deprecated functions in thecrypto
module.MockAppModuleBasic
struct with associated methods for mockingAppModuleBasic
interface.