Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Feb 10, 2021
1 parent 8cf88fe commit 5add13a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 6 additions & 3 deletions types/module/configurator.go
Expand Up @@ -24,6 +24,12 @@ type Configurator interface {
// RegisterMigration registers an in-place store migration for a module. The
// handler is a migration script to perform in-place migrations from version
// `forVersion` to version `forVersion+1`.
//
// EACH TIME a module's ConsensusVersion increments, a new migration MUST
// be registered using this function. If a migration handler is missing for
// a particular function, the upgrade logic (see RunMigrations function)
// will panic. If the ConsensusVersion bump does not introduce any store
// changes, then a no-op function must be registered here.
RegisterMigration(moduleName string, forVersion uint64, handler MigrationHandler) error
}

Expand Down Expand Up @@ -79,9 +85,6 @@ func (c configurator) RegisterMigration(moduleName string, forVersion uint64, ha
// version to another version.
func (c configurator) runModuleMigrations(ctx sdk.Context, moduleName string, fromVersion, toVersion uint64) error {
// No-op if toVersion is the initial version.
// Some modules don't have a store key (e.g. vesting), in this case, their
// ConsensusVersion will always stay at 1, and running migrations on
// those modules will be skipped on this line.
if toVersion <= 1 {
return nil
}
Expand Down
4 changes: 1 addition & 3 deletions types/module/module_test.go
Expand Up @@ -6,7 +6,6 @@ import (
"testing"

"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/simapp"

"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
Expand Down Expand Up @@ -169,7 +168,6 @@ func TestManager_RegisterRoutes(t *testing.T) {
func TestManager_RegisterQueryServices(t *testing.T) {
mockCtrl := gomock.NewController(t)
t.Cleanup(mockCtrl.Finish)
encCfg := simapp.MakeTestEncodingConfig()

mockAppModule1 := mocks.NewMockAppModule(mockCtrl)
mockAppModule2 := mocks.NewMockAppModule(mockCtrl)
Expand All @@ -181,7 +179,7 @@ func TestManager_RegisterQueryServices(t *testing.T) {

msgRouter := mocks.NewMockServer(mockCtrl)
queryRouter := mocks.NewMockServer(mockCtrl)
cfg := module.NewConfigurator(encCfg.Marshaler, msgRouter, queryRouter, nil)
cfg := module.NewConfigurator(msgRouter, queryRouter)
mockAppModule1.EXPECT().RegisterServices(cfg).Times(1)
mockAppModule2.EXPECT().RegisterServices(cfg).Times(1)

Expand Down

0 comments on commit 5add13a

Please sign in to comment.