From 48ce6b2b03b40a10c8d1650f0a749cc03ac2f8ba Mon Sep 17 00:00:00 2001 From: nguyen | decentrio <144610611+trinitys7@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:05:16 +0700 Subject: [PATCH] chore(mint): change mint_epoch_identifier to hour (#381) --- x/mint/keeper/hooks_test.go | 4 ++-- x/mint/keeper/mint_test.go | 12 ++++++------ x/mint/types/params.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x/mint/keeper/hooks_test.go b/x/mint/keeper/hooks_test.go index 7ba536ae..e3eeb8e2 100644 --- a/x/mint/keeper/hooks_test.go +++ b/x/mint/keeper/hooks_test.go @@ -18,7 +18,7 @@ import ( ) const ( - defaultEpochIdentifier = "minute" + defaultEpochIdentifier = "hour" defaultMintingRewardsDistributionStartEpoch int64 = 1 defaultFeeCollectorName = "fee_collector" defaultInflationRate = "0.15" // 15% @@ -77,7 +77,7 @@ func (suite *MintKeeperTestSuite) TestAfterDistributeMintedCoin() { name: "at start epoch - distributes", epoch: defaultMintingRewardsDistributionStartEpoch, expectDistribution: true, - expectedMintedAmt: sdk.NewInt(285), // 285 (15% of 1000M / (365*24*60)) or (inflationRate * totalSupply / spreadFactor) + expectedMintedAmt: sdk.NewInt(17123), // 17123 (15% of 1000M / (365*24)) or (inflationRate * totalSupply / spreadFactor) }, } diff --git a/x/mint/keeper/mint_test.go b/x/mint/keeper/mint_test.go index c657d617..25d9c18d 100644 --- a/x/mint/keeper/mint_test.go +++ b/x/mint/keeper/mint_test.go @@ -31,7 +31,7 @@ func TestMinting(t *testing.T) { // set expectations totalSupplyAmt := sdk.NewInt(100000000) // 100M totalSupplyCoin := sdk.NewCoin(params.MintDenom, totalSupplyAmt) - expectedMintedAmt := sdk.NewInt(28) // 28 (15% of 100M / (365*24*60)) + expectedMintedAmt := sdk.NewInt(1712) // 1712 (15% of 100M / (365*24)) /* ---------------------------------- test ---------------------------------- */ //assert initial state @@ -76,13 +76,13 @@ func TestCalcMintedCoins(t *testing.T) { name: "Test Default Params", totalSupply: sdk.NewInt(100000000), currentInflationRate: sdk.NewDecWithPrec(15, 2), // 15% - expectedAmount: sdk.NewInt(28), + expectedAmount: sdk.NewInt(1712), }, { name: "Test dymension decimals", totalSupply: sdk.NewInt(100000000).Mul(DymDecimals), currentInflationRate: sdk.NewDecWithPrec(15, 2), // 15% - expectedAmount: sdk.NewInt(15000000).Mul(DymDecimals).QuoRaw(365 * 24 * 60), + expectedAmount: sdk.NewInt(15000000).Mul(DymDecimals).QuoRaw(365 * 24), }, } @@ -115,9 +115,9 @@ func TestDifferentMintEpochs(t *testing.T) { expectedAmount math.Int }{ { - name: "Test Minute Mint Epoch", - mintEpoch: "minute", - expectedAmount: sdk.NewInt(10000000).QuoRaw(365 * 24 * 60), + name: "Test Hour Mint Epoch", + mintEpoch: "hour", + expectedAmount: sdk.NewInt(10000000).QuoRaw(365 * 24), }, { name: "Test Day Mint Epoch", diff --git a/x/mint/types/params.go b/x/mint/types/params.go index ecea3f09..3134e17b 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -47,7 +47,7 @@ func NewParams( func DefaultParams() Params { return Params{ MintDenom: sdk.DefaultBondDenom, - MintEpochIdentifier: "minute", + MintEpochIdentifier: "hour", MintStartEpoch: 1, InflationChangeEpochIdentifier: "year", InflationRateChange: sdk.NewDecWithPrec(1, 2), // 1% annual inflation change