Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chores: change mint_epoch_identifier to hour #381

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading