func (m Minter) BlockProvision(params Params) types.Coin {
	provisionAmt := m.AnnualProvisions.QuoInt(types.NewInt(int64(params.BlocksPerYear)))
	return types.NewCoin(params.MintDenom, provisionAmt.TruncateInt())
}
BlockProvision returns the provisions for a block based on the annual
provisions rate.
package types
import (
	"fmt"
	"github.com/KuChainNetwork/kuchain/chain/types"
	sdk "github.com/cosmos/cosmos-sdk/types"
)
type Minter struct {
	Inflation        sdk.Dec `json:"inflation"`                                   
	AnnualProvisions sdk.Dec `json:"annual_provisions" yaml:"annual_provisions"`  
}
func NewMinter(inflation, annualProvisions sdk.Dec) Minter {
	return Minter{
		Inflation:        inflation,
		AnnualProvisions: annualProvisions,
	}
}
func InitialMinter(inflation sdk.Dec) Minter {
	return NewMinter(
		inflation,
		types.NewDec(0),
	)
}
func DefaultInitialMinter() Minter {
	return InitialMinter(
		sdk.NewDecWithPrec(14, 2),
	)
}
func ValidateMinter(minter Minter) error {
	if minter.Inflation.IsNegative() {
		return fmt.Errorf("mint parameter Inflation should be positive, is %s",
			minter.Inflation.String())
	}
	return nil
}
func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) sdk.Dec {
	inflationRateChangePerYear := sdk.OneDec().
		Sub(bondedRatio.Quo(params.GoalBonded)).
		Mul(params.InflationRateChange)
	inflationRateChange := inflationRateChangePerYear.Quo(types.NewDec(int64(params.BlocksPerYear)))
	inflation := m.Inflation.Add(inflationRateChange)  
	if inflation.GT(params.InflationMax) {
		inflation = params.InflationMax
	}
	if inflation.LT(params.InflationMin) {
		inflation = params.InflationMin
	}
	return inflation
}
func (m Minter) NextAnnualProvisions(_ Params, totalSupply sdk.Int) sdk.Dec {
	return m.Inflation.MulInt(totalSupply)
}