fix types.NewZeroAssetError panic error

This commit is contained in:
c9s 2022-11-27 00:24:24 +08:00
parent 98f70756be
commit 50d5449b9a
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -286,7 +286,7 @@ func (e *GeneralOrderExecutor) reduceQuantityAndSubmitOrder(ctx context.Context,
submitOrder.Quantity = q
if e.position.Market.IsDustQuantity(submitOrder.Quantity, price) {
return nil, types.NewZeroAssetError(nil)
return nil, types.NewZeroAssetError(fmt.Errorf("dust quantity"))
}
createdOrder, err2 := e.SubmitOrders(ctx, submitOrder)