From 14c77df5da365e71e8486839dac154acdee51941 Mon Sep 17 00:00:00 2001 From: Otto V Date: Mon, 10 Jan 2022 00:57:38 -0400 Subject: [PATCH] requested refactor. --- x/gov/keeper/subspace.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x/gov/keeper/subspace.go b/x/gov/keeper/subspace.go index 236d31f0c..42b8134f3 100644 --- a/x/gov/keeper/subspace.go +++ b/x/gov/keeper/subspace.go @@ -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 { @@ -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() } }