You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
k.Logger(ctx).Error(fmt.Sprintf("Unable to reset quota for Denom: %s, ChannelId: %s", rateLimit.Path.Denom, rateLimit.Path.ChannelId))
which can be refactored for more idiomatic Go, using early returns and inversions to reduce nesting but also make conditions much simpler to read and reason about so
func (kKeeper) BeginBlocker(ctx sdk.Context) {
// As long as epochStarting is true,// epochNumber will always be >0.epochStarting, epochNumber:=k.CheckHourEpochStarting(ctx)
if!epochStarting {
return
}
for_, rateLimit:=rangek.GetAllRateLimits(ctx) {
ok:=rateLimit.Quota.DurationHours!=0&&epochNumber%rateLimit.Quota.DurationHours==0if!ok {
continue
}
err:=k.ResetRateLimit(ctx, rateLimit.Path.Denom, rateLimit.Path.ChannelId)
iferr!=nil {
k.Logger(ctx).Error(fmt.Sprintf("Unable to reset quota for Denom: %s, ChannelId: %s", rateLimit.Path.Denom, rateLimit.Path.ChannelId))
}
}
}
The text was updated successfully, but these errors were encountered:
Just while reading through this code I noticed this
ibc-rate-limiting/ratelimit/keeper/abci.go
Lines 11 to 17 in 29a35e9
The text was updated successfully, but these errors were encountered: