Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

Commit

Permalink
fix log format of TaskGatherOhlcv
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoul committed Nov 14, 2018
1 parent c8d5d4a commit 7407990
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cryptocurrency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestCryptoOhlcvLatest(t *testing.T) {
if info.Ohlcv["BTC"].Name != "Bitcoin" {
t.FailNow()
}
if info.Ohlcv["BTC"].Quotes["USD"] == nil {
if info.Ohlcv["BTC"].Quote["USD"] == nil {
t.FailNow()
}
}
Expand All @@ -91,10 +91,10 @@ func TestCryptoOhlcvHistorical(t *testing.T) {
if info.Name != "Bitcoin" {
t.FailNow()
}
if info.Ohlcv[0].Quotes["USD"] == nil {
if info.Ohlcv[0].Quote["USD"] == nil {
t.FailNow()
}
if info.Ohlcv[0].Quotes["USD"].Volume == 0 {
if info.Ohlcv[0].Quote["USD"].Volume == 0 {
t.FailNow()
}
}
Expand Down
9 changes: 5 additions & 4 deletions statistics/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ func TaskGatherOhlcv(options *types.Options) {

if data, err := coinmarketcap.GetInstance().CryptoOhlcvHistorical(options); err == nil {
for _, v := range data.Ohlcv {
for _, q := range v.Quotes {
for k, q := range v.Quote {
logger.WithFields(log.Fields{
"symbol": data.Symbol,
"quote": q,
"ctime": v.TimeClose,
"symbol": data.Symbol,
"convert": k,
"quote": q,
"ctime": v.TimeClose,
}).Info("GatherOhlcv")
}
}
Expand Down
2 changes: 1 addition & 1 deletion types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ type Ohlcv struct {
LastUpdated string `json:"last_updated"`
TimeOpen string `json:"time_open"`
TimeClose string `json:"time_close"`
Quotes map[string]*OhlcvQuote `json:"quote"`
Quote map[string]*OhlcvQuote `json:"quote"`
}

// OhlcvQuote structure
Expand Down

0 comments on commit 7407990

Please sign in to comment.