diff --git a/plugins/krakenExchange.go b/plugins/krakenExchange.go index b918c870b..87230694f 100644 --- a/plugins/krakenExchange.go +++ b/plugins/krakenExchange.go @@ -422,8 +422,8 @@ func (k *krakenExchange) getTradeHistory(tradingPair model.TradingPair, maybeCur // GetLatestTradeCursor impl. func (k *krakenExchange) GetLatestTradeCursor() (interface{}, error) { - timeNowSecs := time.Now().Unix() - latestTradeCursor := fmt.Sprintf("%d", timeNowSecs) + timeNowMillis := time.Now().Unix() * 1000 + latestTradeCursor := fmt.Sprintf("%d", timeNowMillis) return latestTradeCursor, nil } diff --git a/plugins/krakenExchange_test.go b/plugins/krakenExchange_test.go index d21e94c7d..a8b96dd66 100644 --- a/plugins/krakenExchange_test.go +++ b/plugins/krakenExchange_test.go @@ -157,12 +157,12 @@ func TestGetTradeHistory(t *testing.T) { } func TestGetLatestTradeCursor(t *testing.T) { - startIntervalSecs := time.Now().Unix() + startIntervalSecs := time.Now().Unix() * 1000 cursor, e := testKrakenExchange.GetLatestTradeCursor() if !assert.NoError(t, e) { return } - endIntervalSecs := time.Now().Unix() + endIntervalSecs := time.Now().Unix() * 1000 if !assert.IsType(t, "string", cursor) { return @@ -174,10 +174,10 @@ func TestGetLatestTradeCursor(t *testing.T) { return } - if !assert.True(t, startIntervalSecs <= cursorInt, fmt.Sprintf("returned cursor (%d) should gte the start time of the function call in seconds (%d)", cursorInt, startIntervalSecs)) { + if !assert.True(t, startIntervalSecs <= cursorInt, fmt.Sprintf("returned cursor (%d) should be gte the start time of the function call in millis (%d)", cursorInt, startIntervalSecs)) { return } - if !assert.True(t, endIntervalSecs >= cursorInt, fmt.Sprintf("returned cursor (%d) should lte the end time of the function call in seconds (%d)", cursorInt, endIntervalSecs)) { + if !assert.True(t, endIntervalSecs >= cursorInt, fmt.Sprintf("returned cursor (%d) should be lte the end time of the function call in millis (%d)", cursorInt, endIntervalSecs)) { return } }