(ctx sdk.Context, tier vtypes.VerificationTier, params vtypes.Params, bond vtypes.ProviderBondRecord)
| 1351 | } |
| 1352 | |
| 1353 | func (k *keeper) validateProviderSlashingHistory(ctx sdk.Context, tier vtypes.VerificationTier, params vtypes.Params, bond vtypes.ProviderBondRecord) error { |
| 1354 | if !vtypes.TierAtLeast(tier, vtypes.TierEstablished) || bond.LastSlashTime == nil { |
| 1355 | return nil |
| 1356 | } |
| 1357 | |
| 1358 | window := cleanHistoryWindowForTier(params, tier) |
| 1359 | if window == 0 { |
| 1360 | return nil |
| 1361 | } |
| 1362 | if bond.LastSlashTime.After(ctx.BlockTime().Add(-window)) { |
| 1363 | return moduletypes.ErrSlashingHistoryViolation |
| 1364 | } |
| 1365 | return nil |
| 1366 | } |
| 1367 | |
| 1368 | type attestationInterval struct { |
| 1369 | start time.Time |
no test coverage detected