diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index ad9527fd251e..3b6c9ed0083b 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -53,6 +53,12 @@ func NewKeeper( panic(fmt.Sprintf("%s module account has not been set", types.NotBondedPoolName)) } + if forkEnabledFunc == nil { + forkEnabledFunc = func(sdk.Context) bool { + return false + } + } + return Keeper{ storeKey: key, cdc: cdc, diff --git a/x/staking/keeper/slash.go b/x/staking/keeper/slash.go index 23049bdfeb49..7d7556eca1ab 100644 --- a/x/staking/keeper/slash.go +++ b/x/staking/keeper/slash.go @@ -255,7 +255,7 @@ func (k Keeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, panic(err) } - if k.forkEnabledFunc != nil && k.forkEnabledFunc(ctx) { + if k.forkEnabledFunc(ctx) { // Handle undelegation after redelegation // Prioritize slashing unbondingDelegation than delegation unbondingDelegation, found := k.GetUnbondingDelegation(ctx, sdk.MustAccAddressFromBech32(redelegation.DelegatorAddress), valDstAddr)