mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 23:16:52 +00:00
committed by
Adrian Gallagher
parent
242b02c382
commit
63a9e9fcb1
@@ -15,6 +15,7 @@ import (
|
||||
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/okgroup"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler"
|
||||
)
|
||||
@@ -307,8 +308,8 @@ func TestPlaceSpotOrderLimit(t *testing.T) {
|
||||
t.Parallel()
|
||||
request := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Price: "100",
|
||||
Size: "100",
|
||||
@@ -324,8 +325,8 @@ func TestPlaceSpotOrderMarket(t *testing.T) {
|
||||
t.Parallel()
|
||||
request := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.MarketOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Market.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Size: "-100",
|
||||
Notional: "100",
|
||||
@@ -341,8 +342,8 @@ func TestPlaceMultipleSpotOrders(t *testing.T) {
|
||||
t.Parallel()
|
||||
order := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Size: "100",
|
||||
Notional: "100",
|
||||
@@ -364,8 +365,8 @@ func TestPlaceMultipleSpotOrdersOverCurrencyLimits(t *testing.T) {
|
||||
t.Parallel()
|
||||
order := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Size: "100",
|
||||
Notional: "100",
|
||||
@@ -391,8 +392,8 @@ func TestPlaceMultipleSpotOrdersOverPairLimits(t *testing.T) {
|
||||
t.Parallel()
|
||||
order := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Size: "100",
|
||||
Notional: "100",
|
||||
@@ -661,8 +662,8 @@ func TestPlaceMarginOrderLimit(t *testing.T) {
|
||||
t.Parallel()
|
||||
request := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "2",
|
||||
Price: "100",
|
||||
Size: "100",
|
||||
@@ -678,8 +679,8 @@ func TestPlaceMarginOrderMarket(t *testing.T) {
|
||||
t.Parallel()
|
||||
request := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.MarketOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Market.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "2",
|
||||
Size: "-100",
|
||||
Notional: "100",
|
||||
@@ -695,8 +696,8 @@ func TestPlaceMultipleMarginOrders(t *testing.T) {
|
||||
t.Parallel()
|
||||
order := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Size: "100",
|
||||
Notional: "100",
|
||||
@@ -718,8 +719,8 @@ func TestPlaceMultipleMarginOrdersOverCurrencyLimits(t *testing.T) {
|
||||
t.Parallel()
|
||||
order := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Size: "100",
|
||||
Notional: "100",
|
||||
@@ -745,8 +746,8 @@ func TestPlaceMultipleMarginOrdersOverPairLimits(t *testing.T) {
|
||||
t.Parallel()
|
||||
order := okgroup.PlaceSpotOrderRequest{
|
||||
InstrumentID: spotCurrency,
|
||||
Type: exchange.LimitOrderType.ToLower().ToString(),
|
||||
Side: exchange.BuyOrderSide.ToLower().ToString(),
|
||||
Type: order.Limit.Lower(),
|
||||
Side: order.Buy.Lower(),
|
||||
MarginTrading: "1",
|
||||
Size: "100",
|
||||
Notional: "100",
|
||||
@@ -1819,13 +1820,13 @@ func TestFormatWithdrawPermissions(t *testing.T) {
|
||||
func TestSubmitOrder(t *testing.T) {
|
||||
TestSetRealOrderDefaults(t)
|
||||
t.Parallel()
|
||||
var orderSubmission = &exchange.OrderSubmission{
|
||||
var orderSubmission = &order.Submit{
|
||||
Pair: currency.Pair{
|
||||
Base: currency.BTC,
|
||||
Quote: currency.USDT,
|
||||
},
|
||||
OrderSide: exchange.BuyOrderSide,
|
||||
OrderType: exchange.LimitOrderType,
|
||||
OrderSide: order.Buy,
|
||||
OrderType: order.Limit,
|
||||
Price: 1,
|
||||
Amount: 1,
|
||||
ClientID: "meowOrder",
|
||||
@@ -1843,7 +1844,7 @@ func TestCancelExchangeOrder(t *testing.T) {
|
||||
TestSetRealOrderDefaults(t)
|
||||
t.Parallel()
|
||||
currencyPair := currency.NewPair(currency.LTC, currency.BTC)
|
||||
var orderCancellation = exchange.OrderCancellation{
|
||||
var orderCancellation = order.Cancel{
|
||||
OrderID: "1",
|
||||
WalletAddress: "1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB",
|
||||
AccountID: "1",
|
||||
@@ -1860,7 +1861,7 @@ func TestCancelAllExchangeOrders(t *testing.T) {
|
||||
TestSetRealOrderDefaults(t)
|
||||
t.Parallel()
|
||||
currencyPair := currency.NewPair(currency.LTC, currency.BTC)
|
||||
var orderCancellation = exchange.OrderCancellation{
|
||||
var orderCancellation = order.Cancel{
|
||||
OrderID: "1",
|
||||
WalletAddress: "1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB",
|
||||
AccountID: "1",
|
||||
@@ -1870,8 +1871,8 @@ func TestCancelAllExchangeOrders(t *testing.T) {
|
||||
resp, err := o.CancelAllOrders(&orderCancellation)
|
||||
testStandardErrorHandling(t, err)
|
||||
|
||||
if len(resp.OrderStatus) > 0 {
|
||||
t.Errorf("%v orders failed to cancel", len(resp.OrderStatus))
|
||||
if len(resp.Status) > 0 {
|
||||
t.Errorf("%d orders failed to cancel", len(resp.Status))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1885,9 +1886,11 @@ func TestGetAccountInfo(t *testing.T) {
|
||||
func TestModifyOrder(t *testing.T) {
|
||||
TestSetRealOrderDefaults(t)
|
||||
t.Parallel()
|
||||
_, err := o.ModifyOrder(&exchange.ModifyOrder{})
|
||||
_, err := o.ModifyOrder(&order.Modify{})
|
||||
if err != common.ErrFunctionNotSupported {
|
||||
t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err)
|
||||
t.Errorf("Expected '%v', received: '%v'",
|
||||
common.ErrFunctionNotSupported,
|
||||
err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1916,7 +1919,9 @@ func TestWithdrawFiat(t *testing.T) {
|
||||
var withdrawFiatRequest = exchange.FiatWithdrawRequest{}
|
||||
_, err := o.WithdrawFiatFunds(&withdrawFiatRequest)
|
||||
if err != common.ErrFunctionNotSupported {
|
||||
t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err)
|
||||
t.Errorf("Expected '%v', received: '%v'",
|
||||
common.ErrFunctionNotSupported,
|
||||
err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1927,6 +1932,8 @@ func TestWithdrawInternationalBank(t *testing.T) {
|
||||
var withdrawFiatRequest = exchange.FiatWithdrawRequest{}
|
||||
_, err := o.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest)
|
||||
if err != common.ErrFunctionNotSupported {
|
||||
t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err)
|
||||
t.Errorf("Expected '%v', received: '%v'",
|
||||
common.ErrFunctionNotSupported,
|
||||
err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user