Kraken: Fix TestGetOpenInterest (#1611)

* Kraken: Fix TestGetOpenInterest

We see daily failures on OpenInterest for Kraken.
This fix assumes that the issue might be related to volume of ETHUSD
open interest, and switches the single pair test to XBTUSD instead

Also isolates the test from others, since we're changing stored pairs
and we might be colliding on the global k

* Kraken: Handle Errors field in futures response
This commit is contained in:
Gareth Kirwan
2024-08-16 05:47:32 +01:00
committed by GitHub
parent 91ff6c5c12
commit 0becfbd0a6
11 changed files with 69 additions and 34 deletions

View File

@@ -2016,7 +2016,7 @@ func TestSubscribeBadResp(t *testing.T) {
}
b := testexch.MockWsInstance[Binance](t, testexch.CurryWsMockUpgrader(t, mock)) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
err := b.Subscribe(channels)
assert.ErrorIs(t, err, errUnknownError, "Subscribe should error errUnknownError")
assert.ErrorIs(t, err, common.ErrUnknownError, "Subscribe should error correctly")
assert.ErrorContains(t, err, "carrots", "Subscribe should error containing the carrots")
}

View File

@@ -46,7 +46,6 @@ var (
// maxWSOrderbookWorkers defines a max amount of workers allowed to execute
// jobs from the job channel
maxWSOrderbookWorkers = 10
errUnknownError = errors.New("unknown error")
)
// WsConnect initiates a websocket connection
@@ -584,7 +583,7 @@ func (b *Binance) manageSubs(op string, subs subscription.List) error {
if v, d, _, rErr := jsonparser.Get(respRaw, "result"); rErr != nil {
err = rErr
} else if d != jsonparser.Null { // null is the only expected and acceptable response
err = fmt.Errorf("%w: %s", errUnknownError, v)
err = fmt.Errorf("%w: %s", common.ErrUnknownError, v)
}
}