From fbdb332925d392ba2c272a82c8d45d25e849d21f Mon Sep 17 00:00:00 2001 From: hirokisan Date: Fri, 22 Dec 2023 18:28:21 +0900 Subject: [PATCH] test(GetPositionInfo): add missing property to response --- .../v5-position-get-position-info.json | 71 +++++++------------ v5_position_service_test.go | 55 +++++++------- 2 files changed, 57 insertions(+), 69 deletions(-) diff --git a/integrationtest/v5/position/testdata/v5-position-get-position-info.json b/integrationtest/v5/position/testdata/v5-position-get-position-info.json index e7e7e34..13ac4b6 100644 --- a/integrationtest/v5/position/testdata/v5-position-get-position-info.json +++ b/integrationtest/v5/position/testdata/v5-position-get-position-info.json @@ -1,58 +1,39 @@ { "category": "linear", - "nextPageCursor": "", + "nextPageCursor": "BTCUSDT%2C1691735404177%2C0", "list": [ { "symbol": "BTCUSDT", - "leverage": "2", - "avgPrice": "22714", - "liqPrice": "0.10", - "riskLimitValue": "2000000", - "takeProfit": "0.00", - "positionValue": "22.714", - "tpslMode": "Full", - "riskId": 1, - "trailingStop": "0.00", - "unrealisedPnl": "1.90344", - "markPrice": "24617.44", - "cumRealisedPnl": "-592.751693", - "positionMM": "0.0000005", - "createdTime": "1637760408825", - "positionIdx": 1, - "positionIM": "0.22714", - "updatedTime": "1676678400081", - "side": "Buy", - "bustPrice": "0.10", - "size": "0.001", - "positionStatus": "Normal", - "stopLoss": "0.00", - "tradeMode": 0 - }, - { - "symbol": "BTCUSDT", - "leverage": "2", + "leverage": "1", "avgPrice": "0", - "liqPrice": "0.00", - "riskLimitValue": "2000000", - "takeProfit": "0.00", - "positionValue": "0", + "liqPrice": "", + "riskLimitValue": "6000000", + "takeProfit": "", + "positionValue": "", "tpslMode": "Full", - "riskId": 1, - "trailingStop": "0.00", - "unrealisedPnl": "0", - "markPrice": "24578.06", - "cumRealisedPnl": "0", + "riskId": 3, + "trailingStop": "0", + "unrealisedPnl": "", + "markPrice": "43577.97", + "cumRealisedPnl": "-1618.71655122", + "adlRankIndicator": 0, + "isReduceOnly": false, + "mmrSysUpdatedTime": "", + "leverageSysUpdatedTime": "", "positionMM": "0", - "createdTime": "1637760408825", - "positionIdx": 2, + "positionBalance": "0", + "createdTime": "1677287853003", + "updatedTime": "1691735404177", + "seq": 8093271558, + "positionIdx": 0, "positionIM": "0", - "updatedTime": "1676678400081", - "side": "Sell", - "bustPrice": "0.00", - "size": "0.000", + "side": "", + "bustPrice": "", + "size": "0", "positionStatus": "Normal", - "stopLoss": "0.00", - "tradeMode": 0 + "stopLoss": "", + "tradeMode": 0, + "autoAddMargin": 0 } ] } \ No newline at end of file diff --git a/v5_position_service_test.go b/v5_position_service_test.go index 387616d..5103d50 100644 --- a/v5_position_service_test.go +++ b/v5_position_service_test.go @@ -27,30 +27,37 @@ func TestV5Position_GetPositionInfo(t *testing.T) { "nextPageCursor": "", "list": []map[string]interface{}{ { - "symbol": "BTCUSDT", - "leverage": "2", - "avgPrice": "22714", - "liqPrice": "0.10", - "riskLimitValue": "2000000", - "takeProfit": "0.00", - "positionValue": "22.714", - "tpslMode": "Full", - "riskId": 1, - "trailingStop": "0.00", - "unrealisedPnl": "1.90344", - "markPrice": "24617.44", - "cumRealisedPnl": "-592.751693", - "positionMM": "0.0000005", - "createdTime": "1637760408825", - "positionIdx": 1, - "positionIM": "0.22714", - "updatedTime": "1676678400081", - "side": "Buy", - "bustPrice": "0.10", - "size": "0.001", - "positionStatus": "Normal", - "stopLoss": "0.00", - "tradeMode": 0, + "symbol": "BTCUSDT", + "leverage": "1", + "avgPrice": "0", + "liqPrice": "", + "riskLimitValue": "6000000", + "takeProfit": "", + "positionValue": "", + "tpslMode": "Full", + "riskId": 3, + "trailingStop": "0", + "unrealisedPnl": "", + "markPrice": "43577.97", + "cumRealisedPnl": "-1618.71655122", + "adlRankIndicator": 0, + "isReduceOnly": false, + "mmrSysUpdatedTime": "", + "leverageSysUpdatedTime": "", + "positionMM": "0", + "positionBalance": "0", + "createdTime": "1677287853003", + "updatedTime": "1691735404177", + "seq": 8093271558, + "positionIdx": 0, + "positionIM": "0", + "side": "", + "bustPrice": "", + "size": "0", + "positionStatus": "Normal", + "stopLoss": "", + "tradeMode": 0, + "autoAddMargin": 0, }, }, },