mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
binance: should return error when order does not contain orderID or clientOrderID
This commit is contained in:
parent
96ffab9cd8
commit
97422f26e7
|
@ -544,6 +544,11 @@ func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) (err
|
||||||
|
|
||||||
if o.OrderID > 0 {
|
if o.OrderID > 0 {
|
||||||
req.OrderID(int64(o.OrderID))
|
req.OrderID(int64(o.OrderID))
|
||||||
|
} else {
|
||||||
|
err = multierr.Append(err, fmt.Errorf(
|
||||||
|
"can not cancel %s order, order does not contain orderID or clientOrderID. %#v",
|
||||||
|
o.Symbol, o))
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err2 := req.Do(ctx)
|
_, err2 := req.Do(ctx)
|
||||||
|
@ -565,6 +570,11 @@ func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) (err
|
||||||
req.OrderID(int64(o.OrderID))
|
req.OrderID(int64(o.OrderID))
|
||||||
} else if len(o.ClientOrderID) > 0 {
|
} else if len(o.ClientOrderID) > 0 {
|
||||||
req.OrigClientOrderID(o.ClientOrderID)
|
req.OrigClientOrderID(o.ClientOrderID)
|
||||||
|
} else {
|
||||||
|
err = multierr.Append(err, fmt.Errorf(
|
||||||
|
"can not cancel %s order, order does not contain orderID or clientOrderID. %#v",
|
||||||
|
o.Symbol, o))
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err2 := req.Do(ctx)
|
_, err2 := req.Do(ctx)
|
||||||
|
@ -584,6 +594,11 @@ func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) (err
|
||||||
req.OrderID(int64(o.OrderID))
|
req.OrderID(int64(o.OrderID))
|
||||||
} else if len(o.ClientOrderID) > 0 {
|
} else if len(o.ClientOrderID) > 0 {
|
||||||
req.OrigClientOrderID(o.ClientOrderID)
|
req.OrigClientOrderID(o.ClientOrderID)
|
||||||
|
} else {
|
||||||
|
err = multierr.Append(err, fmt.Errorf(
|
||||||
|
"can not cancel %s order, order does not contain orderID or clientOrderID. %#v",
|
||||||
|
o.Symbol, o))
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err2 := req.Do(ctx)
|
_, err2 := req.Do(ctx)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user