Skip to content

Commit

Permalink
chore(mint): change mint_epoch_identifier to hour (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 authored Apr 15, 2024
1 parent 8a566e6 commit 48ce6b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions x/mint/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const (
defaultEpochIdentifier = "minute"
defaultEpochIdentifier = "hour"
defaultMintingRewardsDistributionStartEpoch int64 = 1
defaultFeeCollectorName = "fee_collector"
defaultInflationRate = "0.15" // 15%
Expand Down Expand Up @@ -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)
},
}

Expand Down
12 changes: 6 additions & 6 deletions x/mint/keeper/mint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
},
}

Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion x/mint/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48ce6b2

Please sign in to comment.