Skip to content

Commit ac6356b

Browse files
committed
Fix client bugs in GetSymbols and GetHistoricalDaily
1 parent 12c42d2 commit ac6356b

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ type historicalSummaryRequest struct {
337337
// Historical data is only available for prior months, starting with January 2014.
338338
func (c *Client) GetHistoricalDaily(req *HistoricalDailyRequest) ([]*Stats, error) {
339339
var result []*Stats
340-
err := c.getJSON("/stats/historical/daily", nil, &result)
340+
err := c.getJSON("/stats/historical/daily", req, &result)
341341
return result, err
342342
}
343343

client_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ func TestSymbols(t *testing.T) {
120120
if len(symbols) == 0 {
121121
t.Fatal("Received zero symbols")
122122
}
123+
124+
symbol := symbols[0]
125+
if symbol.Symbol == "" || symbol.Name == "" || symbol.Date == "" {
126+
t.Fatal("Failed to decode symbol correctly")
127+
}
123128
}
124129

125130
func TestMarkets(t *testing.T) {
@@ -133,3 +138,15 @@ func TestMarkets(t *testing.T) {
133138
t.Fatal("Received zero markets")
134139
}
135140
}
141+
142+
func TestGetHistoricalDaily(t *testing.T) {
143+
c := setupTestClient()
144+
stats, err := c.GetHistoricalDaily(&HistoricalDailyRequest{Last: 5})
145+
if err != nil {
146+
t.Fatal(err)
147+
}
148+
149+
if len(stats) != 5 {
150+
t.Fatalf("Received %d historical daily stats, expected %d", len(stats), 5)
151+
}
152+
}

interface.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ type Market struct {
202202

203203
type Symbol struct {
204204
// Refers to the symbol represented in Nasdaq Integrated symbology (INET).
205-
Ticker string
205+
Symbol string
206206
// Refers to the name of the company or security.
207207
Name string
208208
// Refers to the date the symbol reference data was generated.
@@ -249,7 +249,7 @@ type Stats struct {
249249
// Refers to IEX’s percentage of total US Equity market volume.
250250
MarketShare float64
251251
// Will be true if the trading day is a half day.
252-
IsHalfDay bool
252+
IsHalfDay int
253253
// Refers to the number of lit shares traded on IEX (single-counted).
254254
LitVolume int
255255
}

0 commit comments

Comments
 (0)