mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 15:55:18 +00:00
c59a491788
* (feat) update x/cdp to run every X blocks based off params (#1814)
* add new cdp module param to protonet genesis
* update cdp / cdp related tests for new module param
* update telemetry docs and setup for collecting against local node
* update kvool commit for new cdp param
(cherry picked from commit 4d62f47773
)
* add tests for configurable x/cdp begin blocker interval param
add migration for default value of param
* make adjustments based off pr feedback
* fix proto back compat check
23 lines
835 B
Go
23 lines
835 B
Go
package v2
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
|
"github.com/kava-labs/kava/x/cdp/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)
|
|
}
|