forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rm upgrade handler and move migration helpers from app/upgrades to x/…
…staking
- Loading branch information
1 parent
40b8762
commit eec7bca
Showing
4 changed files
with
39 additions
and
92 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package v11 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" | ||
) | ||
|
||
// Set initial param values, based on https://github.com/iqlusioninc/liquidity-staking-module/blob/master/x/staking/spec/08_params.md | ||
func SetParamsStaking(ctx sdk.Context, k stakingkeeper.Keeper) { | ||
params := k.GetParams(ctx) | ||
|
||
params.ValidatorBondFactor = sdk.Dec(sdk.NewInt(250)) | ||
params.GlobalLiquidStakingCap = sdk.Dec(sdk.NewInt(25).Quo(sdk.NewInt(100))) | ||
params.ValidatorLiquidStakingCap = sdk.Dec(sdk.NewInt(50).Quo(sdk.NewInt(100))) | ||
|
||
k.SetParams(ctx, params) | ||
} | ||
|
||
// Set each validator's TotalValidatorBondShares and TotalLiquidShares to 0 | ||
func SetAllValidatorBondAndLiquidSharesToZero(ctx sdk.Context, k stakingkeeper.Keeper) { | ||
|
||
for _, Val := range k.GetAllValidators(ctx) { | ||
|
||
Val.TotalValidatorBondShares = sdk.ZeroDec() | ||
Val.TotalLiquidShares = sdk.ZeroDec() | ||
|
||
k.SetValidator(ctx, Val) | ||
} | ||
} | ||
|
||
// Set each validator's ValidatorBond to false | ||
func SetAllDelegationValidatorBondsFalse(ctx sdk.Context, k stakingkeeper.Keeper) { | ||
for _, Del := range k.GetAllDelegations(ctx) { | ||
|
||
Del.ValidatorBond = false | ||
|
||
k.SetDelegation(ctx, Del) | ||
} | ||
} |
File renamed without changes.