Skip to content

Commit

Permalink
Add extra check
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Oct 30, 2024
1 parent 670027d commit d259610
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions x/babylon/keeper/mint_rewards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ func TestMintBlockRewards(t *testing.T) {
expectAmount: sdkmath.ZeroInt(),
expectErr: true,
},
{
name: "zero blocks per year",
setup: func(ctx sdk.Context) {
initialSupply := sdkmath.NewInt(100_000_000_000) // 100_000 tokens
bondDenom, _ := k.StakingKeeper.BondDenom(ctx)
coins := sdk.NewCoins(sdk.NewCoin(bondDenom, initialSupply))
err := k.BankKeeper.MintCoins(ctx, types.ModuleName, coins)
require.NoError(t, err)
},
recipient: sdk.AccAddress("test_recipient"),
inflationRate: sdkmath.LegacyNewDecWithPrec(-5, 2),
blocksPerYear: 0,
expectAmount: sdkmath.ZeroInt(),
expectErr: true,
},
}

for _, tc := range tests {
Expand Down

0 comments on commit d259610

Please sign in to comment.