mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-31 07:26:44 +00:00
linter: Enable gofumpt and run against codebase (#1848)
* linter: Enable gofumpt and run against codebase * Address shazbert's nits * gofumpt: Fix issues after rebase
This commit is contained in:
@@ -405,6 +405,7 @@ func TestGetFundingChartData(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestWSRetrieveFundingChartData(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.WSRetrieveFundingChartData("", "8h")
|
||||
@@ -465,6 +466,7 @@ func TestGetHistoricalVolatility(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestWSRetrieveHistoricalVolatility(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.WSRetrieveHistoricalVolatility(currency.EMPTYCODE)
|
||||
@@ -565,6 +567,7 @@ func TestGetInstrumentsData(t *testing.T) {
|
||||
require.Falsef(t, result[a].IsActive, "expected expired instrument, but got active instrument %s", result[a].InstrumentName)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWSRetrieveInstrumentsData(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.WSRetrieveInstrumentsData(currency.EMPTYCODE, "", false)
|
||||
@@ -584,6 +587,7 @@ func TestGetLastSettlementsByCurrency(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestWSRetrieveLastSettlementsByCurrency(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.WSRetrieveLastSettlementsByCurrency(currency.EMPTYCODE, "delivery", "5", 0, time.Now().Add(-time.Hour))
|
||||
@@ -1897,7 +1901,8 @@ func TestSubmitBuy(t *testing.T) {
|
||||
Label: "testOrder", TimeInForce: "",
|
||||
Trigger: "", Advanced: "",
|
||||
Amount: 30, Price: 500000,
|
||||
MaxShow: 0, TriggerPrice: 0})
|
||||
MaxShow: 0, TriggerPrice: 0,
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidInstrumentName)
|
||||
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
@@ -1908,7 +1913,8 @@ func TestSubmitBuy(t *testing.T) {
|
||||
Amount: 30, Price: 500000,
|
||||
MaxShow: 0, TriggerPrice: 0,
|
||||
PostOnly: false, RejectPostOnly: false,
|
||||
ReduceOnly: false, MMP: false})
|
||||
ReduceOnly: false, MMP: false,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
@@ -1922,7 +1928,8 @@ func TestWSSubmitBuy(t *testing.T) {
|
||||
Label: "testOrder", TimeInForce: "",
|
||||
Trigger: "", Advanced: "",
|
||||
Amount: 30, Price: 500000,
|
||||
MaxShow: 0, TriggerPrice: 0})
|
||||
MaxShow: 0, TriggerPrice: 0,
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidInstrumentName)
|
||||
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
@@ -1933,7 +1940,8 @@ func TestWSSubmitBuy(t *testing.T) {
|
||||
Amount: 30, Price: 500000,
|
||||
MaxShow: 0, TriggerPrice: 0,
|
||||
PostOnly: false, RejectPostOnly: false,
|
||||
ReduceOnly: false, MMP: false})
|
||||
ReduceOnly: false, MMP: false,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
@@ -1952,6 +1960,7 @@ func TestSubmitSell(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestWSSubmitSell(t *testing.T) {
|
||||
t.Parallel()
|
||||
info, err := d.GetInstrument(context.Background(), btcPerpInstrument)
|
||||
@@ -1963,7 +1972,8 @@ func TestWSSubmitSell(t *testing.T) {
|
||||
Label: "testOrder", TimeInForce: "",
|
||||
Trigger: "", Advanced: "", Amount: info.ContractSize * 3,
|
||||
Price: 500000, MaxShow: 0, TriggerPrice: 0, PostOnly: false,
|
||||
RejectPostOnly: false, ReduceOnly: false, MMP: false})
|
||||
RejectPostOnly: false, ReduceOnly: false, MMP: false,
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidInstrumentName)
|
||||
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
@@ -1972,7 +1982,8 @@ func TestWSSubmitSell(t *testing.T) {
|
||||
Label: "testOrder", TimeInForce: "",
|
||||
Trigger: "", Advanced: "", Amount: info.ContractSize * 3,
|
||||
Price: 500000, MaxShow: 0, TriggerPrice: 0, PostOnly: false,
|
||||
RejectPostOnly: false, ReduceOnly: false, MMP: false})
|
||||
RejectPostOnly: false, ReduceOnly: false, MMP: false,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
@@ -1981,16 +1992,22 @@ func TestEditOrderByLabel(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.EditOrderByLabel(context.Background(), &OrderBuyAndSellParams{})
|
||||
require.ErrorIs(t, err, common.ErrNilPointer)
|
||||
_, err = d.EditOrderByLabel(context.Background(), &OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: "",
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false})
|
||||
_, err = d.EditOrderByLabel(context.Background(), &OrderBuyAndSellParams{
|
||||
Label: "incorrectUserLabel", Instrument: "",
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false,
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidInstrumentName)
|
||||
_, err = d.EditOrderByLabel(context.Background(), &OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 0, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false})
|
||||
_, err = d.EditOrderByLabel(context.Background(), &OrderBuyAndSellParams{
|
||||
Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 0, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false,
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidAmount)
|
||||
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
result, err := d.EditOrderByLabel(context.Background(), &OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false})
|
||||
result, err := d.EditOrderByLabel(context.Background(), &OrderBuyAndSellParams{
|
||||
Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
@@ -1999,16 +2016,22 @@ func TestWSEditOrderByLabel(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.WSEditOrderByLabel(&OrderBuyAndSellParams{})
|
||||
require.ErrorIs(t, err, common.ErrNilPointer)
|
||||
_, err = d.WSEditOrderByLabel(&OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: "",
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false})
|
||||
_, err = d.WSEditOrderByLabel(&OrderBuyAndSellParams{
|
||||
Label: "incorrectUserLabel", Instrument: "",
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false,
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidInstrumentName)
|
||||
_, err = d.WSEditOrderByLabel(&OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 0, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false})
|
||||
_, err = d.WSEditOrderByLabel(&OrderBuyAndSellParams{
|
||||
Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 0, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false,
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidAmount)
|
||||
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
result, err := d.WSEditOrderByLabel(&OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false})
|
||||
result, err := d.WSEditOrderByLabel(&OrderBuyAndSellParams{
|
||||
Label: "incorrectUserLabel", Instrument: btcPerpInstrument,
|
||||
Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
@@ -2256,6 +2279,7 @@ func TestWSRetrieveOpenOrdersByCurrency(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetOpenOrdersByLabel(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetOpenOrdersByLabel(context.Background(), currency.EMPTYCODE, "the-label")
|
||||
@@ -2277,6 +2301,7 @@ func TestWSRetrieveOpenOrdersByLabel(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetOpenOrdersByInstrument(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetOpenOrdersByInstrument(context.Background(), "", "all")
|
||||
@@ -2298,6 +2323,7 @@ func TestWSRetrieveOpenOrdersByInstrument(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetOrderHistoryByCurrency(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetOrderHistoryByCurrency(context.Background(), currency.EMPTYCODE, "future", 0, 0, false, false)
|
||||
@@ -2363,6 +2389,7 @@ func TestWSRetrieveOrderMarginsByID(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetOrderState(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetOrderState(context.Background(), "")
|
||||
@@ -2384,6 +2411,7 @@ func TestWSRetrievesOrderState(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetOrderStateByLabel(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetOrderStateByLabel(context.Background(), currency.EMPTYCODE, "the-label")
|
||||
@@ -2405,6 +2433,7 @@ func TestWsRetrieveOrderStateByLabel(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetTriggerOrderHistory(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetTriggerOrderHistory(context.Background(), currency.EMPTYCODE, "", "", 0)
|
||||
@@ -2453,6 +2482,7 @@ func TestWSRetrieveUserTradesByCurrency(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetUserTradesByCurrencyAndTime(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetUserTradesByCurrencyAndTime(context.Background(), currency.EMPTYCODE, "future", "default", 5, time.Now().Add(-time.Hour*10), time.Now().Add(-time.Hour*1))
|
||||
@@ -2474,6 +2504,7 @@ func TestWSRetrieveUserTradesByCurrencyAndTime(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetUserTradesByInstrument(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetUserTradesByInstrument(context.Background(), "", "asc", 5, 10, 4, true)
|
||||
@@ -2495,6 +2526,7 @@ func TestWsRetrieveUserTradesByInstrument(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetUserTradesByInstrumentAndTime(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetUserTradesByInstrumentAndTime(context.Background(), "", "asc", 10, time.Now().Add(-time.Hour), time.Now())
|
||||
@@ -2516,6 +2548,7 @@ func TestWSRetrieveUserTradesByInstrumentAndTime(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetUserTradesByOrder(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetUserTradesByOrder(context.Background(), "", "default")
|
||||
@@ -2537,6 +2570,7 @@ func TestWSRetrieveUserTradesByOrder(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestResetMMP(t *testing.T) {
|
||||
t.Parallel()
|
||||
err := d.ResetMMP(context.Background(), currency.EMPTYCODE)
|
||||
@@ -2556,6 +2590,7 @@ func TestWSResetMMP(t *testing.T) {
|
||||
err = d.WSResetMMP(currency.BTC)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestSendRequestForQuote(t *testing.T) {
|
||||
t.Parallel()
|
||||
err := d.SendRequestForQuote(context.Background(), "", 1000, order.Buy)
|
||||
@@ -2575,6 +2610,7 @@ func TestWSSendRequestForQuote(t *testing.T) {
|
||||
err = d.WSSendRequestForQuote(d.formatFuturesTradablePair(futuresTradablePair), 1000, order.Buy)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestSetMMPConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
err := d.SetMMPConfig(context.Background(), currency.EMPTYCODE, kline.FiveMin, 5, 0, 0)
|
||||
@@ -2641,6 +2677,7 @@ func TestWSRetrieveSettlementHistoryByInstrument(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestSubmitEdit(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.SubmitEdit(context.Background(), &OrderBuyAndSellParams{})
|
||||
@@ -2692,6 +2729,7 @@ func TestWSRetrieveComboIDS(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotEmpty(t, combos)
|
||||
}
|
||||
|
||||
func TestGetComboDetails(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetComboDetails(context.Background(), "")
|
||||
@@ -2711,6 +2749,7 @@ func TestWSRetrieveComboDetails(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetCombos(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetCombos(context.Background(), currency.EMPTYCODE)
|
||||
@@ -2837,6 +2876,7 @@ func TestWSCreateCombo(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestVerifyBlockTrade(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.VerifyBlockTrade(context.Background(), time.Now(), "", "maker", currency.EMPTYCODE, []BlockTradeParam{})
|
||||
@@ -2922,6 +2962,7 @@ func TestWsInvalidateBlockTradeSignature(t *testing.T) {
|
||||
err = d.WsInvalidateBlockTradeSignature("verified_signature_string")
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestExecuteBlockTrade(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.ExecuteBlockTrade(context.Background(), time.Now(), "", "maker", currency.EMPTYCODE, []BlockTradeParam{})
|
||||
@@ -3014,6 +3055,7 @@ func TestWSRetrieveUserBlockTrade(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestGetLastBlockTradesbyCurrency(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.GetLastBlockTradesByCurrency(context.Background(), currency.EMPTYCODE, "", "", 5)
|
||||
@@ -3035,6 +3077,7 @@ func TestWSRetrieveLastBlockTradesByCurrency(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestMovePositions(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.MovePositions(context.Background(), currency.EMPTYCODE, 123, 345, []BlockTradeParam{})
|
||||
@@ -3101,7 +3144,8 @@ func TestWSMovePositions(t *testing.T) {
|
||||
InstrumentName: "",
|
||||
Direction: "buy",
|
||||
Amount: 100,
|
||||
}})
|
||||
},
|
||||
})
|
||||
require.ErrorIs(t, err, errInvalidInstrumentName)
|
||||
_, err = d.WSMovePositions(currency.BTC, 123, 345, []BlockTradeParam{
|
||||
{
|
||||
@@ -3137,6 +3181,7 @@ func TestWSMovePositions(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestSimulateBlockTrade(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.SimulateBlockTrade(context.Background(), "", []BlockTradeParam{})
|
||||
@@ -3253,6 +3298,7 @@ func TestWsSimulateBlockTrade(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func setupWs() {
|
||||
if !d.Websocket.IsEnabled() {
|
||||
return
|
||||
@@ -3392,7 +3438,7 @@ func TestWSRetrievePublicPortfolioMargins(t *testing.T) {
|
||||
func TestCancelAllOrders(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
var orderCancellation = &order.Cancel{
|
||||
orderCancellation := &order.Cancel{
|
||||
OrderID: "1",
|
||||
WalletAddress: core.BitcoinDonationAddress,
|
||||
AccountID: "1",
|
||||
@@ -3448,7 +3494,7 @@ func TestWithdraw(t *testing.T) {
|
||||
func TestGetActiveOrders(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d)
|
||||
var getOrdersRequest = order.MultiOrderRequest{
|
||||
getOrdersRequest := order.MultiOrderRequest{
|
||||
Type: order.AnyType, AssetType: asset.Futures,
|
||||
Side: order.AnySide, Pairs: currency.Pairs{futuresTradablePair},
|
||||
}
|
||||
@@ -3528,7 +3574,7 @@ func TestGetAssetPairByInstrument(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetFeeByTypeOfflineTradeFee(t *testing.T) {
|
||||
var feeBuilder = &exchange.FeeBuilder{
|
||||
feeBuilder := &exchange.FeeBuilder{
|
||||
Amount: 1,
|
||||
FeeType: exchange.CryptocurrencyTradeFee,
|
||||
Pair: futuresTradablePair,
|
||||
@@ -3645,7 +3691,7 @@ func TestModifyOrder(t *testing.T) {
|
||||
func TestCancelOrder(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
var orderCancellation = &order.Cancel{
|
||||
orderCancellation := &order.Cancel{
|
||||
OrderID: "1",
|
||||
WalletAddress: core.BitcoinDonationAddress,
|
||||
AccountID: "1",
|
||||
@@ -3807,6 +3853,7 @@ func TestWsDisableCancelOnDisconnect(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestEnableCancelOnDisconnect(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
@@ -3822,12 +3869,14 @@ func TestWsEnableCancelOnDisconnect(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestLogout(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, d, canManipulateRealOrders)
|
||||
err := d.WsLogout(true)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestExchangeToken(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.ExchangeToken(context.Background(), "", 1234)
|
||||
@@ -3848,6 +3897,7 @@ func TestWsExchangeToken(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
}
|
||||
|
||||
func TestForkToken(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := d.ForkToken(context.Background(), "", "Sami")
|
||||
|
||||
@@ -537,7 +537,7 @@ func (d *Deribit) GetHistoricTrades(ctx context.Context, p currency.Pair, assetT
|
||||
}
|
||||
var resp []trade.Data
|
||||
var tradesData *PublicTradesData
|
||||
var hasMore = true
|
||||
hasMore := true
|
||||
for hasMore {
|
||||
if d.Websocket.IsConnected() {
|
||||
tradesData, err = d.WSRetrieveLastTradesByInstrumentAndTime(instrumentID, "asc", 100, true, timestampStart, timestampEnd)
|
||||
@@ -860,7 +860,7 @@ func (d *Deribit) GetActiveOrders(ctx context.Context, getOrdersRequest *order.M
|
||||
if len(getOrdersRequest.Pairs) == 0 {
|
||||
return nil, currency.ErrCurrencyPairsEmpty
|
||||
}
|
||||
var resp = []order.Detail{}
|
||||
resp := []order.Detail{}
|
||||
for x := range getOrdersRequest.Pairs {
|
||||
fmtPair, err := d.FormatExchangeCurrency(getOrdersRequest.Pairs[x], getOrdersRequest.AssetType)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user