-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
135 additions
and
732 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"fmt" | ||
|
||
"cosmossdk.io/log" | ||
|
||
"github.com/cosmos/cosmos-sdk/runtime" | ||
|
||
icacontrollerkeeper "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/keeper" | ||
icacontrollertypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types" | ||
) | ||
|
||
func (suite *KeeperTestSuite) TestMigratorMigrateParams() { | ||
testCases := []struct { | ||
msg string | ||
malleate func() | ||
expectedParams icacontrollertypes.Params | ||
}{ | ||
{ | ||
"success: default params", | ||
func() { | ||
params := icacontrollertypes.DefaultParams() | ||
subspace := suite.chainA.GetSimApp().GetSubspace(icacontrollertypes.SubModuleName) // get subspace | ||
subspace.SetParamSet(suite.chainA.GetContext(), ¶ms) // set params | ||
}, | ||
icacontrollertypes.DefaultParams(), | ||
}, | ||
{ | ||
"success: no legacy params pre-migration", | ||
func() { | ||
suite.chainA.GetSimApp().ICAControllerKeeper = icacontrollerkeeper.NewKeeper( | ||
suite.chainA.Codec, | ||
runtime.NewEnvironment(runtime.NewKVStoreService(suite.chainA.GetSimApp().GetKey(icacontrollertypes.StoreKey)), log.NewNopLogger()), | ||
nil, // assign a nil legacy param subspace | ||
suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, | ||
suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, | ||
suite.chainA.GetSimApp().ICAControllerKeeper.GetAuthority(), | ||
) | ||
}, | ||
icacontrollertypes.DefaultParams(), | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
tc := tc | ||
|
||
suite.Run(fmt.Sprintf("case %s", tc.msg), func() { | ||
suite.SetupTest() // reset | ||
|
||
tc.malleate() // explicitly set params | ||
|
||
migrator := icacontrollerkeeper.NewMigrator(&suite.chainA.GetSimApp().ICAControllerKeeper) | ||
err := migrator.MigrateParams(suite.chainA.GetContext()) | ||
suite.Require().NoError(err) | ||
|
||
params := suite.chainA.GetSimApp().ICAControllerKeeper.GetParams(suite.chainA.GetContext()) | ||
suite.Require().Equal(tc.expectedParams, params) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
modules/apps/27-interchain-accounts/controller/types/params_legacy.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
modules/apps/27-interchain-accounts/host/keeper/migrations_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"fmt" | ||
|
||
"cosmossdk.io/log" | ||
govtypes "cosmossdk.io/x/gov/types" | ||
|
||
"github.com/cosmos/cosmos-sdk/runtime" | ||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" | ||
|
||
icahostkeeper "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host/keeper" | ||
icahosttypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host/types" | ||
) | ||
|
||
func (suite *KeeperTestSuite) TestMigratorMigrateParams() { | ||
testCases := []struct { | ||
msg string | ||
malleate func() | ||
expectedParams icahosttypes.Params | ||
}{ | ||
{ | ||
"success: default params", | ||
func() { | ||
params := icahosttypes.DefaultParams() | ||
subspace := suite.chainA.GetSimApp().GetSubspace(icahosttypes.SubModuleName) // get subspace | ||
subspace.SetParamSet(suite.chainA.GetContext(), ¶ms) // set params | ||
}, | ||
icahosttypes.DefaultParams(), | ||
}, | ||
{ | ||
"success: no legacy params pre-migration", | ||
func() { | ||
suite.chainA.GetSimApp().ICAHostKeeper = icahostkeeper.NewKeeper( | ||
suite.chainA.Codec, | ||
runtime.NewEnvironment(runtime.NewKVStoreService(suite.chainA.GetSimApp().GetKey(icahosttypes.StoreKey)), log.NewNopLogger()), | ||
nil, // assign a nil legacy param subspace | ||
suite.chainA.GetSimApp().IBCFeeKeeper, | ||
suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, | ||
suite.chainA.GetSimApp().AuthKeeper, | ||
authtypes.NewModuleAddress(govtypes.ModuleName).String(), | ||
) | ||
}, | ||
icahosttypes.DefaultParams(), | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
tc := tc | ||
|
||
suite.Run(fmt.Sprintf("case %s", tc.msg), func() { | ||
suite.SetupTest() // reset | ||
|
||
tc.malleate() // explicitly set params | ||
|
||
migrator := icahostkeeper.NewMigrator(&suite.chainA.GetSimApp().ICAHostKeeper) | ||
err := migrator.MigrateParams(suite.chainA.GetContext()) | ||
suite.Require().NoError(err) | ||
|
||
params := suite.chainA.GetSimApp().ICAHostKeeper.GetParams(suite.chainA.GetContext()) | ||
suite.Require().Equal(tc.expectedParams, params) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.