Skip to content

Commit f4b3272

Browse files
[Bug]Funding Rate History response struct error (#544)
* Update mark_price.go * Update unit test
1 parent c16a07c commit f4b3272

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

v2/futures/mark_price.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ type FundingRate struct {
119119
Symbol string `json:"symbol"`
120120
FundingRate string `json:"fundingRate"`
121121
FundingTime int64 `json:"fundingTime"`
122-
Time int64 `json:"time"`
122+
MarkPrice string `json:"markPrice"`
123123
}
124124

125125
// GetLeverageBracketService get funding rate

v2/futures/mark_price_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ func (s *fundingRateServiceTestSuite) TestGetFundingRate() {
6969
"symbol": "BTCUSDT",
7070
"fundingRate": "-0.03750000",
7171
"fundingTime": 1570608000000,
72-
"time": 1576566020000
72+
"markPrice": "1576566020000"
7373
},
7474
{
7575
"symbol": "BTCUSDT",
7676
"fundingRate": "0.00010000",
7777
"fundingTime": 1570636800000,
78-
"time": 1576566020000
78+
"markPrice": "1576566020000"
7979
}
8080
]`)
8181
s.mockDo(data, nil)
@@ -103,13 +103,13 @@ func (s *fundingRateServiceTestSuite) TestGetFundingRate() {
103103
Symbol: symbol,
104104
FundingRate: "-0.03750000",
105105
FundingTime: int64(1570608000000),
106-
Time: int64(1576566020000),
106+
MarkPrice: "1576566020000",
107107
},
108108
{
109109
Symbol: symbol,
110110
FundingRate: "0.00010000",
111111
FundingTime: int64(1570636800000),
112-
Time: int64(1576566020000),
112+
MarkPrice: "1576566020000",
113113
},
114114
}
115115
s.r().Len(res, len(e))
@@ -123,7 +123,7 @@ func (s *fundingRateServiceTestSuite) assertFundingRateEqual(e, a *FundingRate)
123123
r.Equal(e.Symbol, a.Symbol, "Symbol")
124124
r.Equal(e.FundingRate, a.FundingRate, "FundingRate")
125125
r.Equal(e.FundingTime, a.FundingTime, "FundingTime")
126-
r.Equal(e.Time, a.Time, "Time")
126+
r.Equal(e.MarkPrice, a.MarkPrice, "MarkPrice")
127127
}
128128

129129
type getLeverageBracketServiceTestSuite struct {

0 commit comments

Comments
 (0)