Skip to content

Commit

Permalink
[1658]: Double check that the market details are valid in CreateMarke…
Browse files Browse the repository at this point in the history
…t since it's a public keeper function.
  • Loading branch information
SpicyLemon committed Oct 12, 2023
1 parent 911c023 commit 09e346a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/exchange/keeper/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,8 +1196,9 @@ func (k Keeper) CreateMarket(ctx sdk.Context, market exchange.Market) (uint32, e
var errAsk, errBid error
market.ReqAttrCreateAsk, errAsk = exchange.NormalizeReqAttrs(market.ReqAttrCreateAsk)
market.ReqAttrCreateBid, errBid = exchange.NormalizeReqAttrs(market.ReqAttrCreateBid)
if errAsk != nil || errBid != nil {
return 0, errors.Join(errAsk, errBid)
errDets := market.MarketDetails.Validate()
if errAsk != nil || errBid != nil || errDets != nil {
return 0, errors.Join(errAsk, errBid, errDets)
}

store := k.getStore(ctx)
Expand Down

0 comments on commit 09e346a

Please sign in to comment.