From e0ceb88d49edfd344a30feb2c32026aed9484ae4 Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Sun, 5 Jan 2025 15:05:55 +0700 Subject: [PATCH] GateIO: Rename Get*PersonalTradingHistory to GetMy*TradingHistory --- exchanges/gateio/gateio.go | 8 ++++---- exchanges/gateio/gateio_test.go | 13 +++++++------ exchanges/gateio/gateio_wrapper.go | 5 ++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/exchanges/gateio/gateio.go b/exchanges/gateio/gateio.go index adc2b998ecd..a0df07d9768 100644 --- a/exchanges/gateio/gateio.go +++ b/exchanges/gateio/gateio.go @@ -2940,8 +2940,8 @@ func (g *Gateio) CancelSingleDeliveryOrder(ctx context.Context, settle currency. return response, g.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, deliveryCancelOrderEPL, http.MethodDelete, deliveryPath+settle.Item.Lower+"/orders/"+orderID, nil, nil, &response) } -// GetDeliveryPersonalTradingHistory retrieves personal trading history -func (g *Gateio) GetDeliveryPersonalTradingHistory(ctx context.Context, settle currency.Code, orderID string, contract currency.Pair, limit, offset, countTotal uint64, lastID string) ([]TradingHistoryItem, error) { +// GetMyDeliveryTradingHistory retrieves authenticated account delivery futures trading history +func (g *Gateio) GetMyDeliveryTradingHistory(ctx context.Context, settle currency.Code, orderID string, contract currency.Pair, limit, offset, countTotal uint64, lastID string) ([]TradingHistoryItem, error) { if settle.IsEmpty() { return nil, errEmptyOrInvalidSettlementCurrency } @@ -3406,8 +3406,8 @@ func (g *Gateio) CancelOptionSingleOrder(ctx context.Context, orderID string) (* return response, g.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, optionsCancelOrderEPL, http.MethodDelete, "options/orders/"+orderID, nil, nil, &response) } -// GetOptionsPersonalTradingHistory retrieves personal tradign histories given the underlying{Required}, contract, and other pagination params. -func (g *Gateio) GetOptionsPersonalTradingHistory(ctx context.Context, underlying string, contract currency.Pair, offset, limit uint64, from, to time.Time) ([]OptionTradingHistory, error) { +// GetMyOptionsTradingHistory retrieves authenticated account's option trading history +func (g *Gateio) GetMyOptionsTradingHistory(ctx context.Context, underlying string, contract currency.Pair, offset, limit uint64, from, to time.Time) ([]OptionTradingHistory, error) { if underlying == "" { return nil, errInvalidUnderlying } diff --git a/exchanges/gateio/gateio_test.go b/exchanges/gateio/gateio_test.go index a242a9c18d5..bb56c64f0c2 100644 --- a/exchanges/gateio/gateio_test.go +++ b/exchanges/gateio/gateio_test.go @@ -1155,11 +1155,11 @@ func TestCancelSingleDeliveryOrder(t *testing.T) { assert.NoError(t, err, "CancelSingleDeliveryOrder should not error") } -func TestGetDeliveryPersonalTradingHistory(t *testing.T) { +func TestGetMyDeliveryTradingHistory(t *testing.T) { t.Parallel() sharedtestvalues.SkipTestIfCredentialsUnset(t, g) - _, err := g.GetDeliveryPersonalTradingHistory(context.Background(), currency.USDT, "", getPair(t, asset.DeliveryFutures), 0, 0, 1, "") - assert.NoError(t, err, "GetDeliveryPersonalTradingHistory should not error") + _, err := g.GetMyDeliveryTradingHistory(context.Background(), currency.USDT, "", getPair(t, asset.DeliveryFutures), 0, 0, 1, "") + assert.NoError(t, err, "GetMyDeliveryTradingHistory should not error") } func TestGetDeliveryPositionCloseHistory(t *testing.T) { @@ -1766,11 +1766,12 @@ func TestCancelSingleOrder(t *testing.T) { } } -func TestGetOptionsPersonalTradingHistory(t *testing.T) { +func TestGetMyOptionsTradingHistory(t *testing.T) { t.Parallel() + sharedtestvalues.SkipTestIfCredentialsUnset(t, g) - if _, err := g.GetOptionsPersonalTradingHistory(context.Background(), "BTC_USDT", currency.EMPTYPAIR, 0, 0, time.Time{}, time.Time{}); err != nil { - t.Errorf("%s GetOptionPersonalTradingHistory() error %v", g.Name, err) + if _, err := g.GetMyOptionsTradingHistory(context.Background(), "BTC_USDT", currency.EMPTYPAIR, 0, 0, time.Time{}, time.Time{}); err != nil { + t.Errorf("%s GetMyOptionsTradingHistory() error %v", g.Name, err) } } diff --git a/exchanges/gateio/gateio_wrapper.go b/exchanges/gateio/gateio_wrapper.go index 4992d9a0cd4..7f158bf7627 100644 --- a/exchanges/gateio/gateio_wrapper.go +++ b/exchanges/gateio/gateio_wrapper.go @@ -1878,7 +1878,7 @@ func (g *Gateio) GetOrderHistory(ctx context.Context, req *order.MultiOrderReque if req.AssetType == asset.Futures { futuresOrder, err = g.GetMyFuturesTradingHistory(ctx, settle, "", req.FromOrderID, fPair, 0, 0, 0) } else { - futuresOrder, err = g.GetDeliveryPersonalTradingHistory(ctx, settle, req.FromOrderID, fPair, 0, 0, 0, "") + futuresOrder, err = g.GetMyDeliveryTradingHistory(ctx, settle, req.FromOrderID, fPair, 0, 0, 0, "") } if err != nil { return nil, err @@ -1900,8 +1900,7 @@ func (g *Gateio) GetOrderHistory(ctx context.Context, req *order.MultiOrderReque case asset.Options: for x := range req.Pairs { fPair := req.Pairs[x].Format(format) - var optionOrders []OptionTradingHistory - optionOrders, err = g.GetOptionsPersonalTradingHistory(ctx, fPair.String(), fPair.Upper(), 0, 0, req.StartTime, req.EndTime) + optionOrders, err := g.GetMyOptionsTradingHistory(ctx, fPair.String(), fPair.Upper(), 0, 0, req.StartTime, req.EndTime) if err != nil { return nil, err }