Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt committed Dec 1, 2023
1 parent 36b9b72 commit 8ab1965
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
7 changes: 0 additions & 7 deletions x/inflation/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,27 +161,20 @@ func TestPeriodChangesSkippedEpochsAfterEpochEnd(t *testing.T) {

// Perform Epoch Hooks
futureCtx := ctx.WithBlockTime(time.Now().Add(time.Minute))
fmt.Println("tc.height", tc.height)
nibiruApp.EpochsKeeper.BeforeEpochStart(futureCtx, tc.epochIdentifier, tc.height)
nibiruApp.EpochsKeeper.AfterEpochEnd(futureCtx, tc.epochIdentifier, tc.height)

skippedEpochs := nibiruApp.InflationKeeper.NumSkippedEpochs.Peek(ctx)
period := nibiruApp.InflationKeeper.CurrentPeriod.Peek(ctx)

if tc.periodChanges {
fmt.Println("periodChanges", tc.periodChanges)
newProvision := nibiruApp.InflationKeeper.GetEpochMintProvision(ctx)

expectedProvision := types.CalculateEpochMintProvision(
nibiruApp.InflationKeeper.GetParams(ctx),
period,
)

fmt.Println("periodChanges", tc.periodChanges)
fmt.Println("newProvision", newProvision)
fmt.Println("expectedProvision", expectedProvision)
fmt.Println("originalProvision", originalProvision)

require.Equal(t, expectedProvision, newProvision)
// mint provisions will change
require.NotEqual(t, newProvision, originalProvision)
Expand Down
24 changes: 12 additions & 12 deletions x/inflation/keeper/inflation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func TestMintAndAllocateInflation(t *testing.T) {
{
name: "pass",
coinsToMint: sdk.NewCoin(denoms.NIBI, sdk.NewInt(1_000_000)),
expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)),
expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)),
expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(622_000)),
expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)),
expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)),
expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(622_000))),
expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)),
expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)),
expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(351_591)),
expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)),
expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)),
expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(351_591))),
rootAccount: "nibi1qyqf35fkhn73hjr70442fctpq8prpqr9ysj9sn",
},
{
Expand All @@ -59,12 +59,12 @@ func TestMintAndAllocateInflation(t *testing.T) {
{
name: "pass - no root account",
coinsToMint: sdk.NewCoin(denoms.NIBI, sdk.NewInt(1_000_000)),
expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)),
expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)),
expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(622_000)),
expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)),
expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)),
expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(622_000))),
expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)),
expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)),
expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(351_591)),
expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)),
expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)),
expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(351_591))),
rootAccount: "",
},
}
Expand Down

0 comments on commit 8ab1965

Please sign in to comment.