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 (#1700)

This change tightens the test by directly unit testing that
AppModuleBasic.DefaultGenesis returns a non-nil result.
The test in #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 #1666
Updates PR #1667
  • Loading branch information
odeke-em authored Aug 5, 2024
1 parent 7419f3a commit b8379a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions x/interchainquery/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,13 @@ 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 reported in https://github.com/quicksilver-zone/quicksilver/issues/1666
func (s *InterChainQueryTestSuite) TestAssertAppModuleBasicMarshalNonNilJSON() {
app := s.GetSimApp(s.chainA)
mod := new(interchainquery.AppModuleBasic)
blob := mod.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 b8379a6

Please sign in to comment.