-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): migrate client params (#3640)
* feat(client): migrate client params * Address initial feedback. * Use anonymous function as handler. * Add tests for msg_server. whoops. * Revert anon function as handler. * Implicitly test GetAllowedClients in TestDefaultSetParams. * Consistency is more important than perfection. * Add msg.signer option back, remove cosmos.scalar for the time being. * Remove authority comment, update GetParams as per suggestion. * Update modules/core/02-client/keeper/keeper.go Co-authored-by: Damian Nolan <damiannolan@gmail.com> * Update modules/core/keeper/keeper.go Co-authored-by: Damian Nolan <damiannolan@gmail.com> * Check that new parameters updated match what is expected. * Add note to migration docs. --------- Co-authored-by: Damian Nolan <damiannolan@gmail.com>
- Loading branch information
1 parent
25de1c4
commit d61886d
Showing
23 changed files
with
820 additions
and
121 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"github.com/cosmos/ibc-go/v7/modules/core/02-client/keeper" | ||
"github.com/cosmos/ibc-go/v7/modules/core/02-client/types" | ||
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" | ||
) | ||
|
||
// TestMigrateParams tests the migration for the client params | ||
func (suite *KeeperTestSuite) TestMigrateParams() { | ||
testCases := []struct { | ||
name string | ||
malleate func() | ||
expectedParams types.Params | ||
}{ | ||
{ | ||
"success: default params", | ||
func() { | ||
params := types.DefaultParams() | ||
subspace := suite.chainA.GetSimApp().GetSubspace(ibcexported.ModuleName) | ||
subspace.SetParamSet(suite.chainA.GetContext(), ¶ms) | ||
}, | ||
types.DefaultParams(), | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
tc := tc | ||
suite.Run(tc.name, func() { | ||
suite.SetupTest() // reset | ||
|
||
tc.malleate() | ||
|
||
ctx := suite.chainA.GetContext() | ||
migrator := keeper.NewMigrator(suite.chainA.GetSimApp().IBCKeeper.ClientKeeper) | ||
err := migrator.MigrateParams(ctx) | ||
suite.Require().NoError(err) | ||
|
||
params := suite.chainA.GetSimApp().IBCKeeper.ClientKeeper.GetParams(ctx) | ||
suite.Require().Equal(tc.expectedParams, params) | ||
}) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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.