Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "exclude validator addresses from being genesis staking" #23

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,17 +842,13 @@ func (app *TerraApp) enforceStakingForVestingTokens(ctx sdk.Context, genesisStat

allValidators := app.StakingKeeper.GetAllValidators(ctx)

// Filter out validators which have huge max commission than 20%
var validators []stakingtypes.Validator
validatorAccAddressMap := make(map[string]bool)
maxCommissionCondition := sdk.NewDecWithPrec(20, 2)
for _, val := range allValidators {

// Filter out validators which have huge max commission than 20%
if val.Commission.CommissionRates.MaxRate.LTE(maxCommissionCondition) {
validators = append(validators, val)
}

validatorAccAddressMap[sdk.AccAddress(val.GetOperator()).String()] = true
}

validatorLen := len(validators)
Expand All @@ -872,12 +868,6 @@ func (app *TerraApp) enforceStakingForVestingTokens(ctx sdk.Context, genesisStat
}

if vestingAcc, ok := account.(vestingexported.VestingAccount); ok {

// skip genesis staking if the vesting account is validator address
if _, ok := validatorAccAddressMap[vestingAcc.GetAddress().String()]; ok {
continue
}

amt := vestingAcc.GetOriginalVesting().AmountOf(app.StakingKeeper.BondDenom(ctx))

// to prevent staking multiple times over the same validator
Expand Down