Skip to content

Commit

Permalink
added devs comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stackman27 committed Jul 5, 2022
1 parent fdfbce0 commit 367f933
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions osmoutils/cli_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ func ParseSdkIntFromString(s string, separator string) ([]sdk.Int, error) {
// ConditionalPanic checks if expectPanic is true, asserts that sut (system under test)
// panics. If expectPanic is false, asserts that sut does not panic.
// returns true if sut panics and false it it doesnot
func ConditionalPanic(t *testing.T, expectPanic bool, sut func()) bool {
func ConditionalPanic(t *testing.T, expectPanic bool, sut func()) {
if expectPanic {
require.Panics(t, sut)
return true
return
}

require.NotPanics(t, sut)
return false
}
4 changes: 2 additions & 2 deletions x/mint/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ func (suite *KeeperTestSuite) TestMintInitGenesis() {
originalVestingCoins := bankKeeper.GetBalance(ctx, developerAccount, tc.mintDenom)

// Test.

if osmoutils.ConditionalPanic(suite.T(), tc.expectPanic || false, func() { mintKeeper.InitGenesis(ctx, tc.mintGenesis) }) {
osmoutils.ConditionalPanic(suite.T(), tc.expectPanic, func() { mintKeeper.InitGenesis(ctx, tc.mintGenesis) })
if tc.expectPanic {
return
}

Expand Down

0 comments on commit 367f933

Please sign in to comment.