-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #721 from Pylons-tech/migrate_46
new param migrate
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v046 | ||
|
||
import ( | ||
"github.com/Pylons-tech/pylons/x/pylons/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" | ||
) | ||
|
||
func migrateParamsStore(ctx sdk.Context, paramstore paramtypes.Subspace) { | ||
if paramstore.HasKeyTable() { | ||
paramstore.Set(ctx, types.ParamStoreKeyMaxTxsInBlock, types.DefaultMaxTxsInBlock) | ||
} else { | ||
paramstore.WithKeyTable(types.ParamKeyTable()) | ||
paramstore.Set(ctx, types.ParamStoreKeyMaxTxsInBlock, types.DefaultMaxTxsInBlock) | ||
} | ||
} | ||
|
||
// MigrateStore performs in-place store migrations from v0.43 to v0.46. The | ||
// migration includes: | ||
// | ||
// - Migrate proposals to be Msg-based. | ||
func MigrateStore(ctx sdk.Context, paramstore paramtypes.Subspace) error { | ||
migrateParamsStore(ctx, paramstore) | ||
return nil | ||
} |