mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* Fix bitmex order params * Fix insecure endpoint check * comment on Title funcs * tests for Title func * fix order_test Co-authored-by: Allie c( ⁰ 〰 ⁰ )੭ <88z@pm.me>
This commit is contained in:
@@ -437,10 +437,10 @@ func (b *Bitmex) SubmitOrder(s *order.Submit) (order.SubmitResponse, error) {
|
||||
}
|
||||
|
||||
var orderNewParams = OrderNewParams{
|
||||
OrderType: s.Side.String(),
|
||||
OrderType: s.Type.Title(),
|
||||
Symbol: s.Pair.String(),
|
||||
OrderQuantity: s.Amount,
|
||||
Side: s.Side.String(),
|
||||
Side: s.Side.Title(),
|
||||
}
|
||||
|
||||
if s.Type == order.Limit {
|
||||
|
||||
@@ -631,7 +631,7 @@ func (e *Base) SetAPIURL() error {
|
||||
}
|
||||
|
||||
checkInsecureEndpoint := func(endpoint string) {
|
||||
if !strings.Contains(endpoint, "https") {
|
||||
if strings.Contains(endpoint, "https") {
|
||||
return
|
||||
}
|
||||
log.Warnf(log.ExchangeSys,
|
||||
|
||||
@@ -92,7 +92,11 @@ func TestOrderSides(t *testing.T) {
|
||||
}
|
||||
|
||||
if os.Lower() != "buy" {
|
||||
t.Errorf("unexpected string %s", os.String())
|
||||
t.Errorf("unexpected string %s", os.Lower())
|
||||
}
|
||||
|
||||
if os.Title() != "Buy" {
|
||||
t.Errorf("unexpected string %s", os.Title())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +112,10 @@ func TestOrderTypes(t *testing.T) {
|
||||
if ot.Lower() != "mo'money" {
|
||||
t.Errorf("unexpected string %s", ot.Lower())
|
||||
}
|
||||
|
||||
if ot.Title() != "Mo'Money" {
|
||||
t.Errorf("unexpected string %s", ot.Title())
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterOrdersByType(t *testing.T) {
|
||||
|
||||
@@ -349,6 +349,11 @@ func (t Type) Lower() string {
|
||||
return strings.ToLower(string(t))
|
||||
}
|
||||
|
||||
// Title returns the type titleized, eg "Limit"
|
||||
func (t Type) Title() string {
|
||||
return strings.Title(strings.ToLower(string(t)))
|
||||
}
|
||||
|
||||
// String implements the stringer interface
|
||||
func (s Side) String() string {
|
||||
return string(s)
|
||||
@@ -359,6 +364,11 @@ func (s Side) Lower() string {
|
||||
return strings.ToLower(string(s))
|
||||
}
|
||||
|
||||
// Title returns the side titleized, eg "Buy"
|
||||
func (s Side) Title() string {
|
||||
return strings.Title(strings.ToLower(string(s)))
|
||||
}
|
||||
|
||||
// String implements the stringer interface
|
||||
func (s Status) String() string {
|
||||
return string(s)
|
||||
|
||||
Reference in New Issue
Block a user