Skip to content

Commit

Permalink
requested refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Otto V authored and oten91 committed Jan 10, 2022
1 parent 8f72921 commit 14c77df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions x/gov/keeper/subspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
"github.com/pokt-network/pocket-core/x/gov/types"
)

const maxValidatorChangeAllowedHeight = 40000
const maxValidatorChangeAllowedMinHeight = 40000
const maxValidatorACLKey = "pos/MaxValidators"

// Allocate subspace used for keepers
func (k Keeper) Subspace(s string) sdk.Subspace {
Expand Down Expand Up @@ -178,8 +179,9 @@ func (k Keeper) ModifyParam(ctx sdk.Ctx, aclKey string, paramValue []byte, owner
return err.Result()
}

if ctx.BlockHeight() >= maxValidatorChangeAllowedHeight {
if !k.cdc.IsAfterSecondUpgrade(ctx.BlockHeight()) && aclKey == "pos/MaxValidators" {
if ctx.BlockHeight() >= maxValidatorChangeAllowedMinHeight {

if !k.cdc.IsAfterSecondUpgrade(ctx.BlockHeight()) && aclKey == maxValidatorACLKey {
return types.ErrUnauthorizedHeightParamChange(types.ModuleName, codec.UpgradeHeight, aclKey).Result()
}
}
Expand Down

0 comments on commit 14c77df

Please sign in to comment.