func (gm GlobalManager) OnBeginBlock(ctx sdk.Context) {
	blockTime := ctx.BlockHeader().Time.Unix()
	globalTime := gm.storage.GetGlobalTime(ctx)
	if blockTime < globalTime.LastBlockTime {
		return
	}
	pastMinutes := globalTime.PastMinutes
	nowMinutes := (blockTime - globalTime.ChainStartTime) / 60
	for next := pastMinutes + 1; next <= nowMinutes; next++ {
		gm.execBCEventsAt(ctx, next)
	}
	globalTime.PastMinutes = nowMinutes
	gm.storage.SetGlobalTime(ctx, globalTime)
}
OnBeginBlock - update internal time related fields and execute
blockchain scheduled events.
package manager
import (
	"fmt"
	"strconv"
	codec "github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/lino-network/lino/param"
	linotypes "github.com/lino-network/lino/types"
	"github.com/lino-network/lino/utils"
	"github.com/lino-network/lino/x/global/model"
	"github.com/lino-network/lino/x/global/types"
)
const (
	exportVersion = 2
	importVersion = 2
)
type GlobalManager struct {
	storage     model.GlobalStorage
	paramHolder param.ParamKeeper
	hourly  linotypes.BCEventExec
	daily   linotypes.BCEventExec
	monthly linotypes.BCEventExec
	yearly  linotypes.BCEventExec
}
func NewGlobalManager(key sdk.StoreKey, keeper param.ParamKeeper, cdc *codec.Codec,
	hourly linotypes.BCEventExec,
	daily linotypes.BCEventExec,
	monthly linotypes.BCEventExec,
	yearly linotypes.BCEventExec,
) GlobalManager {
	return GlobalManager{
		storage:     model.NewGlobalStorage(key, cdc),
		paramHolder: keeper,
		hourly:      hourly,
		daily:       daily,
		monthly:     monthly,
		yearly:      yearly,
	}
}
func (gm GlobalManager) InitGenesis(ctx sdk.Context) {
	gm.storage.SetGlobalTime(ctx, &model.GlobalTime{
		ChainStartTime: ctx.BlockTime().Unix(),
		LastBlockTime:  ctx.BlockTime().Unix(),
		PastMinutes:    0,
	})
}