0g-chain/x/cdp/migrations/v2/store.go
0g-wh 822e374be6 rebase to kava cosmos 0.47 upgrade
rename

rename

tidy

clean code
2024-09-25 15:18:12 +00:00

22 lines
794 B
Go

package v2
import (
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
)
// MigrateStore performs in-place store migrations for consensus version 2
// V2 adds the begin_blocker_execution_block_interval param to parameters.
func MigrateStore(ctx sdk.Context, paramstore paramtypes.Subspace) error {
migrateParamsStore(ctx, paramstore)
return nil
}
// migrateParamsStore ensures the param key table exists and has the begin_blocker_execution_block_interval property
func migrateParamsStore(ctx sdk.Context, paramstore paramtypes.Subspace) {
if !paramstore.HasKeyTable() {
paramstore.WithKeyTable(types.ParamKeyTable())
}
paramstore.Set(ctx, types.KeyBeginBlockerExecutionBlockInterval, types.DefaultBeginBlockerExecutionBlockInterval)
}