diff --git a/x/meshsecurity/keeper/adapter.go b/x/meshsecurity/keeper/adapter.go index c7914979..66993ae9 100644 --- a/x/meshsecurity/keeper/adapter.go +++ b/x/meshsecurity/keeper/adapter.go @@ -2,6 +2,7 @@ package keeper import ( "cosmossdk.io/math" + "time" sdk "github.com/cosmos/cosmos-sdk/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -114,13 +115,13 @@ func NewStakingDecorator(stakingKeeper slashingtypes.StakingKeeper, k *Keeper) * } // Slash captures the slash event and calls the decorated staking keeper slash method -func (s StakingDecorator) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, power int64, height int64, slashRatio sdk.Dec) math.Int { +func (s StakingDecorator) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, power int64, height int64, slashRatio sdk.Dec, timeInfraction time.Time) math.Int { val := s.StakingKeeper.ValidatorByConsAddr(ctx, consAddr) totalSlashAmount := s.StakingKeeper.Slash(ctx, consAddr, power, height, slashRatio) if val == nil { ModuleLogger(ctx). Error("can not propagate slash: validator not found", "validator", consAddr.String()) - } else if err := s.k.ScheduleSlashed(ctx, val.GetOperator(), power, height, totalSlashAmount, slashRatio); err != nil { + } else if err := s.k.ScheduleSlashed(ctx, val.GetOperator(), power, height, totalSlashAmount, slashRatio, timeInfraction); err != nil { ModuleLogger(ctx). Error("can not propagate slash: schedule event", "cause", err, @@ -130,8 +131,8 @@ func (s StakingDecorator) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, power } // SlashWithInfractionReason implementation doesn't require the infraction (types.Infraction) to work but is required by Interchain Security. -func (s StakingDecorator) SlashWithInfractionReason(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec, _ stakingtypes.Infraction) math.Int { - return s.Slash(ctx, consAddr, infractionHeight, power, slashFactor) +func (s StakingDecorator) SlashWithInfractionReason(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec, timeInfraction time.Time, _ stakingtypes.Infraction) math.Int { + return s.Slash(ctx, consAddr, infractionHeight, power, slashFactor, timeInfraction) } // Jail captures the jail event and calls the decorated staking keeper jail method