Skip to content

Commit

Permalink
Remove panic
Browse files Browse the repository at this point in the history
  • Loading branch information
haasted committed Mar 16, 2021
1 parent 9656581 commit d8d5382
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/market/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ func (k *Keeper) NewOrderSingle(ctx sdk.Context, aggressiveOrder types.Order) (*
nextSourceFilledCoin := sdk.NewCoin(passiveOrder.Source.Denom, stepSourceFilled.RoundInt())
err := k.transferTradedAmounts(ctx, nextDestinationFilledCoin, nextSourceFilledCoin, passiveOrder.Owner, aggressiveOrder.Owner)
if err != nil {
panic(err)
fmt.Println(nextDestinationFilledCoin, nextSourceFilledCoin)
} else {
types.EmitFillEvent(ctx, *passiveOrder, false, stepSourceFilled.RoundInt(), stepDestinationFilled.RoundInt())
}

types.EmitFillEvent(ctx, *passiveOrder, false, stepSourceFilled.RoundInt(), stepDestinationFilled.RoundInt())

if passiveOrder.IsFilled() {
k.deleteOrder(ctx, passiveOrder)
types.EmitExpireEvent(ctx, *passiveOrder)
Expand Down

0 comments on commit d8d5382

Please sign in to comment.