From 8be34bf7995521c39699b20c1f1c4967e193fe98 Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 24 Jul 2024 15:47:44 -0400 Subject: [PATCH] fixing inflation api --- x/jklmint/keeper/keeper.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/jklmint/keeper/keeper.go b/x/jklmint/keeper/keeper.go index 2ad3567a..ad9e7bd5 100644 --- a/x/jklmint/keeper/keeper.go +++ b/x/jklmint/keeper/keeper.go @@ -97,7 +97,13 @@ func (k Keeper) GetInflation(ctx sdk.Context) (sdk.Dec, error) { var blocksPerYearEstiamte int64 = (365 * 24 * 60 * 60) / 6 - printedPerYear := blocksPerYearEstiamte * 1_000_000 * params.TokensPerBlock + mintedNum := params.TokensPerBlock + minted, found := k.GetMintedBlock(ctx, ctx.BlockHeight()-1) + if found { + mintedNum = minted.Minted + } + + printedPerYear := blocksPerYearEstiamte * mintedNum inflate := sdk.NewDec(printedPerYear)