func BeginBlocker(ctx sdk.Context, k Keeper) {
	minter := k.GetMinter(ctx)
	params := k.GetParams(ctx)
	logger := ctx.Logger()
	totalStakingSupply := k.StakingTokenSupply(ctx)
	bondedRatio := k.BondedRatio(ctx)
	minter.Inflation = minter.NextInflationRate(params, bondedRatio)
	minter.AnnualProvisions = minter.NextAnnualProvisions(params, totalStakingSupply)
	k.SetMinter(ctx, minter)
	logger.Debug("mint begin",
		"totalStakingSupply", totalStakingSupply,
		"bondedRatio", bondedRatio,
		"inflation", minter.Inflation,
		"annualProvisions", minter.AnnualProvisions)
	mintedCoin := minter.BlockProvision(params)
	mintedCoins := chainTypes.NewCoins(mintedCoin)
	logger.Debug("minted coins", "coin", mintedCoins, "params", params)
	err := k.MintCoins(ctx, &mintedCoins)
	if err != nil {
		panic(err)
	}
	err = k.AddCollectedFees(ctx, mintedCoins)
	if err != nil {
		panic(err)
	}
	ctx.EventManager().EmitEvent(
		sdk.NewEvent(
			types.EventTypeMint,
			sdk.NewAttribute(types.AttributeKeyBondedRatio, bondedRatio.String()),
			sdk.NewAttribute(types.AttributeKeyInflation, minter.Inflation.String()),
			sdk.NewAttribute(types.AttributeKeyAnnualProvisions, minter.AnnualProvisions.String()),
			sdk.NewAttribute(sdk.AttributeKeyAmount, mintedCoin.Amount.String()),
		),
	)
}
BeginBlocker mints new tokens for the previous block.
package mint
import (
	chainTypes "github.com/KuChainNetwork/kuchain/chain/types"
	"github.com/KuChainNetwork/kuchain/x/mint/types"
	sdk "github.com/cosmos/cosmos-sdk/types"
)