Skip to content

Commit

Permalink
Address unit test comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonWeng committed Apr 26, 2023
1 parent f34981b commit 278c8a7
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion x/mint/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) {
expectedAmount := int64(100000)
newMinter := seiApp.MintKeeper.GetMinter(ctx)

if i == 25 {
if i == 24 {
require.Zero(t, newMinter.GetRemainingMintAmount(), "Remaining amount should be zero")
break
}
Expand Down Expand Up @@ -250,6 +250,27 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) {
require.Equal(t, postOutageTime.Format(minttypes.TokenReleaseDateFormat), newMinter.GetLastMintDate(), "Last mint date should be correct")
require.InDelta(t, 127315, newMinter.GetLastMintAmountCoin().Amount.Int64(), 1, "Minted amount should be correct")
require.InDelta(t, int64(1018522), int64(newMinter.GetRemainingMintAmount()), 24, "Remaining amount should be correct")

// Continue and ensure that eventually reaches zero
for i := 16; i < 25; i++ {
currTime := genesisTime.AddDate(0, 0, i)
currEpoch := getEpoch(genesisTime, currTime)
seiApp.EpochKeeper.BeforeEpochStart(ctx, currEpoch)
seiApp.EpochKeeper.AfterEpochEnd(ctx, currEpoch)
mintParams = seiApp.MintKeeper.GetParams(ctx)

newMinter := seiApp.MintKeeper.GetMinter(ctx)
expectedAmount := int64(127315)

if i == 24 {
require.Zero(t, newMinter.GetRemainingMintAmount(), "Remaining amount should be zero")
break
}

require.Equal(t, currTime.Format(minttypes.TokenReleaseDateFormat), newMinter.GetLastMintDate(), "Last mint date should be correct")
require.InDelta(t, expectedAmount, newMinter.GetLastMintAmountCoin().Amount.Int64(), 1, "Minted amount should be correct")
}

})
}

Expand Down

0 comments on commit 278c8a7

Please sign in to comment.