dimitri-xyz / haskell-coinbase-pro

A Haskell client for the Coinbase Pro API
MIT License
11 stars 6 forks source link

Fix failing tests #20

Closed ericpashman closed 4 years ago

ericpashman commented 4 years ago

There are seven tests that consistently fail right now, all related to REST API calls. All of these tests also failed before the dependency set update.

One failure is an error parsing into the Account type, (via the getAccounts call; the failing test is labeled getUSDAccountLedger). The FromJSON instance is derived generically. It looks like Coinbase changed a JSON field from a number to a string?

Five of the other six test failures are HTTP 400 "Bad Request": "OrderValidation" errors, and the sixth (getOrderList) fails with the message "Received empty order list". Presumably these are all due to a common cause, which looks like it probably has to do with the order-creation action defined in the tests, creatNewLimitOrder [sic].

One or two other tests sometimes fail for me due to rate limiting. The docs show that the rate limit for public endpoints is three calls per second, so these tests are in fact likely to get rate-limited sometimes if we're not explicitly delaying them (are we?). Our tests must be strangely slow for this not to happen more often if we're not delaying the calls.

I'll get to work on this tomorrow, probably, unless you want to tackle it before then, @dimitri-xyz.

ericpashman commented 4 years ago

Whoops, meant to post this under your existing issue.