Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
spoo-bar committed Mar 13, 2023
1 parent e91a7ee commit a8c1563
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion e2e/gastracking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ func (s *E2ETestSuite) TestGasTrackingAndRewardsDistribution() {
{
ctx := chain.GetContext()

mintedCoin, _ := chain.GetApp().MintKeeper.GetBlockProvisions(ctx)
mintedAmount, _ := chain.GetApp().MintKeeper.GetBlockProvisions(ctx)
mintedCoin := sdk.NewInt64Coin(chain.GetApp().StakingKeeper.BondDenom(ctx), mintedAmount.BigInt().Int64())
inflationRewards, _ := pkg.SplitCoins(sdk.NewCoins(mintedCoin), inflationRewardsRatio)
s.Require().Len(inflationRewards, 1)
blockInflationRewardsExpected = inflationRewards[0]
Expand Down
3 changes: 2 additions & 1 deletion e2e/txfees_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func (s *E2ETestSuite) TestTxFees() {
{
ctx := chain.GetContext()

mintedCoin, _ := chain.GetApp().MintKeeper.GetBlockProvisions(ctx)
mintedAmount, _ := chain.GetApp().MintKeeper.GetBlockProvisions(ctx)
mintedCoin := sdk.NewInt64Coin(chain.GetApp().StakingKeeper.BondDenom(ctx), mintedAmount.BigInt().Int64())
s.T().Logf("x/mint minted amount per block: %s", coinsToStr(mintedCoin))
}

Expand Down
7 changes: 4 additions & 3 deletions x/mint/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ func (s *KeeperTestSuite) TestBeginBlocker() {
})

s.Run("OK: last mint was just now. should not mint any tokens", func() {

mintabci.BeginBlocker(ctx, k)

_, found := k.GetInflationForRecipient(ctx, authtypes.FeeCollectorName)
s.Require().False(found)
_, found = k.GetInflationForRecipient(ctx, REWARDSMODULE)
_, found = s.chain.GetApp().RewardsKeeper.GetInflationForRewards(ctx)
s.Require().False(found)
})

s.Run("OK: last mint was a 5 seconds ago. should mint some tokens and update lbi", func() {
ctx = ctx.WithBlockTime(currentTime)
ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1).WithBlockTime(currentTime)

mintabci.BeginBlocker(ctx, k)

Expand All @@ -47,7 +48,7 @@ func (s *KeeperTestSuite) TestBeginBlocker() {
s.Require().True(found)
s.Require().True(feeCollected.Amount.GT(sdk.ZeroInt()))

rewardsCollected, found := k.GetInflationForRecipient(ctx, REWARDSMODULE)
rewardsCollected, found := s.chain.GetApp().RewardsKeeper.GetInflationForRewards(ctx)
s.Require().True(found)
s.Require().True(rewardsCollected.Amount.GT(sdk.ZeroInt()))

Expand Down

0 comments on commit a8c1563

Please sign in to comment.