2020-08-17 17:09:02 +00:00
|
|
|
package issuance
|
|
|
|
|
|
|
|
import (
|
2023-08-25 22:14:35 +00:00
|
|
|
"time"
|
|
|
|
|
2024-08-02 11:32:08 +00:00
|
|
|
"github.com/0glabs/0g-chain/x/issuance/keeper"
|
|
|
|
"github.com/0glabs/0g-chain/x/issuance/types"
|
2023-08-25 22:14:35 +00:00
|
|
|
"github.com/cosmos/cosmos-sdk/telemetry"
|
2020-08-17 17:09:02 +00:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 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
|
|
|
}
|