Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Feb 29, 2024
1 parent 230f449 commit e21933e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions x/staking/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion x/staking/keeper/slash.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e21933e

Please sign in to comment.