Skip to content

Commit

Permalink
test(x/interchainquery): directly assert AppModuleBasic.DefaultGenesi…
Browse files Browse the repository at this point in the history
…s return non-nil JSON

This change tightens the test by directly unit testing that
AppModuleBasic.DefaultGenesis returns a non-nil result.
The test in quicksilver-zone#1666 is an outward API invocation but with
the layers of indirection above, this code down below
could change without notice, preventing effective testing
and making for code rot.

Updates issue quicksilver-zone#1666
Updates PR quicksilver-zone#1667
  • Loading branch information
odeke-em committed Jul 27, 2024
1 parent de7a37c commit e7d5935
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions x/interchainquery/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,12 @@ func newSimAppPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path {

return path
}

// Assert to ensure that there is no panic on directly invoking .DefaultGenesis on AppModuleBasic
// as previously report in https://github.com/quicksilver-zone/quicksilver/issues/1666
func (s *InterChainQueryTestSuite) TestAssertAppModuleBasicMarshalNonNilJSON() {
app := s.GetSimApp(s.chainA)
blob := app.DefaultGenesis(app.AppCodec)
s.True(blob != nil, "the JSON cannot be nil")
s.True(len(blob) > 1, "the length must be non-empty")
}

0 comments on commit e7d5935

Please sign in to comment.