Skip to content

Commit

Permalink
[1699]: Do some of the market id comparisons as ints for better failu…
Browse files Browse the repository at this point in the history
…re output.
  • Loading branch information
SpicyLemon committed Oct 30, 2023
1 parent 7117309 commit a9b5010
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions x/exchange/keeper/market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ func (s *TestSuite) TestKeeper_IterateKnownMarketIDs() {
s.k.IterateKnownMarketIDs(s.ctx, tc.cb)
}
s.Require().NotPanics(testFunc, "IterateKnownMarketIDs")
s.Assert().Equal(tc.expMarketIDs, marketIDs, "IterateKnownMarketIDs market ids")
assertEqualSlice(s, tc.expMarketIDs, marketIDs, func(marketID uint32) string {
return fmt.Sprintf("%d", marketID)
}, "IterateKnownMarketIDs market ids")
})
}
}
Expand Down Expand Up @@ -6037,7 +6039,7 @@ func (s *TestSuite) TestKeeper_CreateMarket() {
}
s.Require().NotPanics(testFunc, "CreateMarket")
s.assertErrorValue(err, tc.expErr, "CreateMarket error")
s.Assert().Equal(tc.expMarketID, marketID, "CreateMarket market id")
s.Assert().Equal(int(tc.expMarketID), int(marketID), "CreateMarket market id")
s.assertAccountKeeperCalls(tc.accKeeper, expCalls, "CreateMarket")
actEvents := em.Events()
s.assertEqualEvents(expEvents, actEvents, "events emitted during CreateMarket")
Expand All @@ -6053,7 +6055,7 @@ func (s *TestSuite) TestKeeper_CreateMarket() {
s.Assert().Equal(&expMarket, market, "market read from state after CreateMarket")

lastMarketID := keeper.GetLastAutoMarketID(s.getStore())
s.Assert().Equal(tc.expLastAutoID, lastMarketID, "last auto-market id after CreateMarket")
s.Assert().Equal(int(tc.expLastAutoID), int(lastMarketID), "last auto-market id after CreateMarket")
})
}
}
Expand Down

0 comments on commit a9b5010

Please sign in to comment.