From 8ab1965a2181e4c92717f03a4cf98eb2f6b2a8b6 Mon Sep 17 00:00:00 2001 From: matthiasmatt Date: Fri, 1 Dec 2023 15:55:41 +0100 Subject: [PATCH] fix: fix tests --- x/inflation/keeper/hooks_test.go | 7 ------- x/inflation/keeper/inflation_test.go | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/x/inflation/keeper/hooks_test.go b/x/inflation/keeper/hooks_test.go index 0db86f9bc..a64f0a048 100644 --- a/x/inflation/keeper/hooks_test.go +++ b/x/inflation/keeper/hooks_test.go @@ -161,7 +161,6 @@ 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) @@ -169,7 +168,6 @@ func TestPeriodChangesSkippedEpochsAfterEpochEnd(t *testing.T) { period := nibiruApp.InflationKeeper.CurrentPeriod.Peek(ctx) if tc.periodChanges { - fmt.Println("periodChanges", tc.periodChanges) newProvision := nibiruApp.InflationKeeper.GetEpochMintProvision(ctx) expectedProvision := types.CalculateEpochMintProvision( @@ -177,11 +175,6 @@ func TestPeriodChangesSkippedEpochsAfterEpochEnd(t *testing.T) { 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) diff --git a/x/inflation/keeper/inflation_test.go b/x/inflation/keeper/inflation_test.go index 0394dfc5e..b2bbbe338 100644 --- a/x/inflation/keeper/inflation_test.go +++ b/x/inflation/keeper/inflation_test.go @@ -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", }, { @@ -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: "", }, }