mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
8186367c8b
* Add consolidate methods * Update distr feepool balance with dust, add tests * Set params for proposal handler to not influence module balances * Add StakingRewardsPerSecond param for proposal test * Update changelog * Update test to check emitted events * Log dust amounts for x/distribution * Modify feepool communitypool field instead of entire replacement * Update tests to include cases with empty balances * Move EventsContains to app * Remove extra copied ModuleName * Add Require() to incentive claims in tests to reduce errors * Move consolidate tests to testutil * Only transfer non-ukava coins * Add DefaultStakingRewardsState to proposal handler test * Move event emit before consolidate * add golangci specific timeout --------- Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
36 lines
728 B
Go
36 lines
728 B
Go
package v2
|
|
|
|
import (
|
|
"time"
|
|
|
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
|
|
|
sdkmath "cosmossdk.io/math"
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/kava-labs/kava/x/community/types"
|
|
)
|
|
|
|
// Migrate migrates the x/community module state from the consensus version 1 to
|
|
// version 2. Specifically, sets new parameters in the module state.
|
|
func Migrate(
|
|
ctx sdk.Context,
|
|
store storetypes.KVStore,
|
|
cdc codec.BinaryCodec,
|
|
) error {
|
|
params := types.NewParams(
|
|
time.Time{},
|
|
sdkmath.LegacyNewDec(0),
|
|
sdkmath.LegacyNewDec(0),
|
|
)
|
|
|
|
if err := params.Validate(); err != nil {
|
|
return err
|
|
}
|
|
|
|
bz := cdc.MustMarshal(¶ms)
|
|
store.Set(types.ParamsKey, bz)
|
|
|
|
return nil
|
|
}
|