2020-08-17 17:09:02 +00:00
|
|
|
package issuance
|
|
|
|
|
|
|
|
import (
|
2023-08-25 22:14:35 +00:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/telemetry"
|
2020-08-17 17:09:02 +00:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
"github.com/kava-labs/kava/x/issuance/keeper"
|
2023-08-25 22:14:35 +00:00
|
|
|
"github.com/kava-labs/kava/x/issuance/types"
|
2020-08-17 17:09:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// BeginBlocker iterates over each asset and seizes coins from blocked addresses by returning them to the asset owner
|
|
|
|
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) {
|
2023-08-25 22:14:35 +00:00
|
|
|
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker)
|
|
|
|
|
2020-08-21 22:56:20 +00:00
|
|
|
err := k.SeizeCoinsForBlockableAssets(ctx)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
2020-08-17 17:09:02 +00:00
|
|
|
}
|
2020-08-21 22:56:20 +00:00
|
|
|
k.SynchronizeBlockList(ctx)
|
|
|
|
k.UpdateTimeBasedSupplyLimits(ctx)
|
2020-08-17 17:09:02 +00:00
|
|
|
}
|