mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Kucoin: Fix unmarshalling of FuturesTicker resp (#1414)
* Kucoin: Fix unmarshalling of FuturesTicker resp * Fix several string float64 fields not unmarshalling * Fix time field misnamed; Make a time.Time * Use order.Side for sides * Add tests This change opts to expose float64 instead of StringToFloat64 because there's no wrapper to convert the type over, and it's not a websocket. Essentially choosing to not expose internal convert types for methods called directly. Possible we'll eventually harmonise this with a types.Number or something. * Kucoin: FuturesRealTimeTicker => FuturesTicker Kucoin only call it RealTime in the first sentence of their docs. None of the API names, endpoints or any thing mention RealTime. This is just a ticker * Tests: Improve clarity of failed push data * Kucoin: Move PushData to a fixture file This avoids both the linter errors, and the bloat. Loses the name of the "test", but I think that's okay
This commit is contained in:
@@ -177,9 +177,8 @@ func TestFixtureToDataHandler(t *testing.T, seed, e exchange.IBotExchange, fixtu
|
||||
s := bufio.NewScanner(fixture)
|
||||
for s.Scan() {
|
||||
msg := s.Bytes()
|
||||
if err := reader(msg); err != nil {
|
||||
t.Errorf("%v from message: %s", err, msg)
|
||||
}
|
||||
err := reader(msg)
|
||||
assert.NoErrorf(t, err, "Fixture message should not error:\n%s", msg)
|
||||
}
|
||||
assert.NoError(t, s.Err(), "Fixture Scanner should not error")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user