-
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
refactor: modules should implement appmodule.AppModule #18252
Conversation
WalkthroughThis pull request introduces context handling in the Changes
TipsChat with CodeRabbit Bot (
|
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: 4
Configuration used: CodeRabbit UI
Files selected for processing (7)
- baseapp/testutil/mock/mocks.go (1 hunks)
- store/mock/cosmos_cosmos_db_DB.go (1 hunks)
- testutil/mock/types_mock_appmodule.go (2 hunks)
- testutil/mock/types_module_module.go (2 hunks)
- types/module/core_module.go (2 hunks)
- types/module/module.go (2 hunks)
- x/slashing/testutil/expected_keepers_mocks.go (1 hunks)
Files skipped from review due to trivial changes (5)
- store/mock/cosmos_cosmos_db_DB.go
- testutil/mock/types_module_module.go
- types/module/core_module.go
- types/module/module.go
- x/slashing/testutil/expected_keepers_mocks.go
Additional comments: 4
baseapp/testutil/mock/mocks.go (4)
210-215: The function signature for
SelectTxForProposal
has been updated to include acontext.Context
parameter. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.218-221: The function signature for
SelectTxForProposal
in theMockTxSelectorMockRecorder
struct has been updated to include acontext.Context
parameter. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.224-229: The function signature for
SelectedTxs
has been updated to include acontext.Context
parameter. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.232-234: The function signature for
SelectedTxs
in theMockTxSelectorMockRecorder
struct has been updated to include acontext.Context
parameter. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.
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.
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!
(cherry picked from commit 797ae0f)
…) (#18255) Co-authored-by: Julien Robert <julien@rbrt.fr>
Description
This PR makes sure all SDK modules implement from now
appmodule.AppModule
as well.This is clearly already recommended by us (autocli and other functionalities check a module is a module by checking this interface): https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md#all-1 and easy to forget (cosmos/ibc-go#4607).
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
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...
!
in the type prefix if API or client breaking changeSummary by CodeRabbit
MockTxSelector
functions to handle cancellation and timeouts more efficiently, improving the reliability of the system.DB
interface, facilitating more comprehensive and efficient testing.MockAppModuleWithAllExtensions
andMockAppModuleWithAllExtensionsABCI
structs with new methods, enhancing the testing capabilities.CoreAppModuleBasicAdaptor
function toCoreAppModuleAdaptor
and added a newCoreAppModuleBasicAdaptor
function for better code organization.AppModule
that extendsappmodule.AppModule
, ensuring all modules implement the necessary functions, thereby improving the robustness of the system.AddressCodec
to theMockAccountKeeper
struct, improving the testing scope.scripts/mockgen.sh
script to reflect changes in the mock generation process.