Skip to content

Commit

Permalink
fix: fix invariant to use best order price
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcre committed Aug 7, 2023
1 parent 902de0e commit fee5197
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/exchange/keeper/invariants.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ func OrderBookInvariant(k Keeper) sdk.Invariant {
msg := ""
cnt := 0
k.IterateAllMarkets(ctx, func(market types.Market) (stop bool) {
bestBuyPrice, found := k.getBestPrice(ctx, market, true)
bestBuyPrice, found := k.GetBestOrderPrice(ctx, market.Id, true)
if !found { // Skip
return false
}
bestSellPrice, found := k.getBestPrice(ctx, market, false)
bestSellPrice, found := k.GetBestOrderPrice(ctx, market.Id, false)
if !found { // Skip
return false
}
Expand Down

0 comments on commit fee5197

Please sign in to comment.