diff --git a/x/mint/types/minter.go b/x/mint/types/minter.go index d82ddd7..db4e9f8 100644 --- a/x/mint/types/minter.go +++ b/x/mint/types/minter.go @@ -52,8 +52,8 @@ func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) sdk.Dec { inflationRateChangePerYear := sdk.OneDec(). Sub(bondedRatio.Quo(params.InflationParameters.GoalBonded)). Mul(params.InflationParameters.InflationRateChange) - inflationRateChange := inflationRateChangePerYear.Quo(sdk.NewDec(int64(params.InflationParameters.BlocksPerYear))) + inflationRateChange := inflationRateChangePerYear.QuoInt(sdk.NewIntFromUint64(params.InflationParameters.BlocksPerYear)) // adjust the new annual inflation for this next cycle inflation := m.Inflation.Add(inflationRateChange) // note inflationRateChange may be negative if inflation.GT(params.InflationParameters.InflationMax) { @@ -75,6 +75,6 @@ func (m Minter) NextAnnualProvisions(_ Params, totalSupply sdk.Int) sdk.Dec { // BlockProvision returns the provisions for a block based on the annual // provisions rate. func (m Minter) BlockProvision(params Params) sdk.Coin { - provisionAmt := m.AnnualProvisions.QuoInt(sdk.NewInt(int64(params.InflationParameters.BlocksPerYear))) + provisionAmt := m.AnnualProvisions.QuoInt(sdk.NewIntFromUint64(params.InflationParameters.BlocksPerYear)) return sdk.NewCoin(params.MintDenom, provisionAmt.TruncateInt()) } diff --git a/x/mint/types/minter_test.go b/x/mint/types/minter_test.go index 69146ce..60b6a91 100644 --- a/x/mint/types/minter_test.go +++ b/x/mint/types/minter_test.go @@ -2,6 +2,7 @@ package types import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" )