From 239bde7d50fa10b1b0e7a71e433431eeb6787947 Mon Sep 17 00:00:00 2001 From: Kenneth Tang <32535494+ChengYen-Tang@users.noreply.github.com> Date: Sun, 18 Feb 2024 22:40:09 +0800 Subject: [PATCH 1/2] Update mark_price.go --- v2/futures/mark_price.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/futures/mark_price.go b/v2/futures/mark_price.go index 7eac000f..365f48ca 100644 --- a/v2/futures/mark_price.go +++ b/v2/futures/mark_price.go @@ -119,7 +119,7 @@ type FundingRate struct { Symbol string `json:"symbol"` FundingRate string `json:"fundingRate"` FundingTime int64 `json:"fundingTime"` - Time int64 `json:"time"` + MarkPrice int64 `json:"markPrice"` } // GetLeverageBracketService get funding rate From f90a7043d8a868dc20d9bbb664ffe0ebd148598c Mon Sep 17 00:00:00 2001 From: Kenneth Tang Date: Sun, 3 Mar 2024 01:03:01 +0800 Subject: [PATCH 2/2] Update unit test --- v2/futures/mark_price.go | 2 +- v2/futures/mark_price_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/v2/futures/mark_price.go b/v2/futures/mark_price.go index 365f48ca..f4e34d50 100644 --- a/v2/futures/mark_price.go +++ b/v2/futures/mark_price.go @@ -119,7 +119,7 @@ type FundingRate struct { Symbol string `json:"symbol"` FundingRate string `json:"fundingRate"` FundingTime int64 `json:"fundingTime"` - MarkPrice int64 `json:"markPrice"` + MarkPrice string `json:"markPrice"` } // GetLeverageBracketService get funding rate diff --git a/v2/futures/mark_price_test.go b/v2/futures/mark_price_test.go index 867f91bd..e4a15111 100644 --- a/v2/futures/mark_price_test.go +++ b/v2/futures/mark_price_test.go @@ -69,13 +69,13 @@ func (s *fundingRateServiceTestSuite) TestGetFundingRate() { "symbol": "BTCUSDT", "fundingRate": "-0.03750000", "fundingTime": 1570608000000, - "time": 1576566020000 + "markPrice": "1576566020000" }, { "symbol": "BTCUSDT", "fundingRate": "0.00010000", "fundingTime": 1570636800000, - "time": 1576566020000 + "markPrice": "1576566020000" } ]`) s.mockDo(data, nil) @@ -103,13 +103,13 @@ func (s *fundingRateServiceTestSuite) TestGetFundingRate() { Symbol: symbol, FundingRate: "-0.03750000", FundingTime: int64(1570608000000), - Time: int64(1576566020000), + MarkPrice: "1576566020000", }, { Symbol: symbol, FundingRate: "0.00010000", FundingTime: int64(1570636800000), - Time: int64(1576566020000), + MarkPrice: "1576566020000", }, } s.r().Len(res, len(e)) @@ -123,7 +123,7 @@ func (s *fundingRateServiceTestSuite) assertFundingRateEqual(e, a *FundingRate) r.Equal(e.Symbol, a.Symbol, "Symbol") r.Equal(e.FundingRate, a.FundingRate, "FundingRate") r.Equal(e.FundingTime, a.FundingTime, "FundingTime") - r.Equal(e.Time, a.Time, "Time") + r.Equal(e.MarkPrice, a.MarkPrice, "MarkPrice") } type getLeverageBracketServiceTestSuite struct {