Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lockwarr committed Sep 30, 2024
1 parent 66264a3 commit c8af6c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions x/mint/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ import (
)

var (
normInitialTotal = types.CalcTokensByIntegral(types.NormOffset)
nanoSecondsInMonth = sdkmath.LegacyNewDec(time.Hour.Nanoseconds() * 24 * 30)
nanoSecondsInFormula = types.MonthsInFormula.Mul(nanoSecondsInMonth)
twelveMonths = sdkmath.LegacyMustNewDecFromStr("12.0")
normInitialTotal = types.CalcTokensByIntegral(types.NormOffset)
nanoSecondsInMonth = sdkmath.LegacyNewDec(time.Hour.Nanoseconds() * 24 * 30)
twelveMonths = sdkmath.LegacyMustNewDecFromStr("12.0")

errTimeInFutureBeforeTimePassed = errors.New("time in future can not be before passed time")
errNegativeBlockTime = errors.New("block time can not be less then zero")
Expand Down Expand Up @@ -65,6 +64,7 @@ func calcTokens(blockTime sdkmath.Uint, minter *types.Minter, maxMintableSeconds

return updateMinter(minter, blockTime, newNormTime, delta)
} else {
// After 120 months, we don't mint any more tokens.
return sdkmath.ZeroUint()
}
}
Expand Down
1 change: 1 addition & 0 deletions x/mint/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func Test_CalcTokensDuringFormula_WhenUsingVaryingIncrements_OutputExpectedToken
expectedNormTime20Sec, normTimeThreshold, minter.NormTimePassed)
}
}

func Test_CalcTokens_WhenMintingAllTokens_OutputsExactExpectedTokens(t *testing.T) {
minter, mintedCoins, mintedMonth, timeOffset := defaultParams()
prevOffset := timeOffset
Expand Down
4 changes: 2 additions & 2 deletions x/mint/types/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/Nolus-Protocol/nolus-core/custom/util"
)

// Legacy Minting formula integral-4.33275 x^3 + 952.82456 x^2 - 88567.49981 x + 3.86381×10^6 dx = -1.08319 x^4 + 317.608 x^3 - 44283.7 x^2 + 3863810 x + constant
// Legacy Minting formula integral-4.33275 x^3 + 952.82456 x^2 - 88567.49981 x + 3.86381×10^6 dx = -1.08319 x^4 + 317.608 x^3 - 44283.7 x^2 + 3863810 x + constant.

// Current Minting formula integral-0.11175 x^3 + 50.82456 x^2 - 1767.49981 x + 0.83381×10^6 dx = -0.0279375 x^4 + 16.9415 x^3 - 883.75 x^2 + 833810 x + constant
// Current Minting formula integral-0.11175 x^3 + 50.82456 x^2 - 1767.49981 x + 0.83381×10^6 dx = -0.0279375 x^4 + 16.9415 x^3 - 883.75 x^2 + 833810 x + constant.
var (
QuadCoef = sdkmath.LegacyMustNewDecFromStr("-0.0279375")
CubeCoef = sdkmath.LegacyMustNewDecFromStr("16.9415")
Expand Down

0 comments on commit c8af6c1

Please sign in to comment.