Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kraken: Fix wsCancelOrders not erroring with order id #1505

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

gbjk
Copy link
Collaborator

@gbjk gbjk commented Mar 16, 2024

We were using the "cancel many" facility of the Kraken api. However since that doesn't actually report errors individually, it seems saner to just multiplex over it.
We were going to get N+ responses anyway. Might as well send N+ requests

One thing I'm unhappy about is the change of Key/Secret for this to work.
I really don't like that there's special values for the auth values which get silently ignored, such as Test, Mock, Key, Secret, etc.
So I've ended up using something adhoc, and putting a require in the test to ensure it's obvious if the auth-conn isn't connected.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested

  • go test ./... -race
  • golangci-lint run
  • TestWsCancelOrders

@gbjk gbjk added the bug label Mar 16, 2024
@gbjk gbjk self-assigned this Mar 16, 2024
@thrasher- thrasher- added review me This pull request is ready for review builds require fixing labels Mar 17, 2024
@gbjk gbjk force-pushed the feature/kraken_cancel_orders branch 3 times, most recently from 1b26681 to f34ffc6 Compare March 20, 2024 08:10
Copy link
Collaborator

@gloriousCode gloriousCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cancel orders change works well 🎉

exchanges/kraken/kraken_types.go Outdated Show resolved Hide resolved
exchanges/kraken/kraken_test.go Show resolved Hide resolved
exchanges/kraken/kraken_test.go Outdated Show resolved Hide resolved
exchanges/kraken/kraken_test.go Outdated Show resolved Hide resolved
testdata/configtest.json Outdated Show resolved Hide resolved
internal/testing/exchange/exchange.go Show resolved Hide resolved
exchanges/kraken/kraken_test.go Show resolved Hide resolved
@gbjk gbjk requested a review from gloriousCode March 22, 2024 02:27
@gbjk
Copy link
Collaborator Author

gbjk commented Mar 22, 2024

I'm not liking those failures in kraken's TestWsOpenOrders; Sniffing it now

@gloriousCode gloriousCode added pending response awaiting a response from the author and removed review me This pull request is ready for review labels Mar 24, 2024
@gbjk
Copy link
Collaborator Author

gbjk commented Mar 26, 2024

TestWsOpenOrders errors were unrelated. This is good to review.

@gbjk gbjk added review me This pull request is ready for review and removed pending response awaiting a response from the author labels Mar 26, 2024
Copy link
Collaborator

@gloriousCode gloriousCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making those changes! tACK!

As an extra, would you consider this diff? Otherwise, I can just put on another PR. I just wanted to get rid of the func setupWsTests while I was here

@gbjk
Copy link
Collaborator Author

gbjk commented Mar 27, 2024

Already in the next upcoming branch.

I've got significant testing of Subscribe in there without mocking, so I'm on the fence about adding a mock for it if we don't have to ( perversely ).

Anyway, Let's touch on this when that PR lands.

@gbjk gbjk requested review from thrasher- and shazbert April 8, 2024 08:17
@gbjk gbjk mentioned this pull request Apr 14, 2024
5 tasks
@gloriousCode gloriousCode added the gcrc GloriousCode Review Complete label Apr 14, 2024
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff. tACK.

exchanges/kraken/kraken_test.go Show resolved Hide resolved
exchanges/kraken/kraken_websocket.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 83.01887% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 36.02%. Comparing base (b909e15) to head (e7e5a5e).
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1505      +/-   ##
==========================================
- Coverage   37.83%   36.02%   -1.82%     
==========================================
  Files         411      411              
  Lines      147204   176906   +29702     
==========================================
+ Hits        55699    63728    +8029     
- Misses      83733   105391   +21658     
- Partials     7772     7787      +15     
Files Coverage Δ
common/common.go 94.79% <100.00%> (+0.03%) ⬆️
internal/testing/exchange/exchange.go 63.02% <78.57%> (-0.62%) ⬇️
exchanges/kraken/kraken_websocket.go 39.36% <76.00%> (+5.67%) ⬆️

... and 385 files with indirect coverage changes

Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are lovely. Thanks.

Copy link
Collaborator

@thrasher- thrasher- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

@gbjk gbjk force-pushed the feature/kraken_cancel_orders branch from ebf4876 to 1849749 Compare April 17, 2024 01:10
@gbjk
Copy link
Collaborator Author

gbjk commented Apr 17, 2024

Rebased and ready to roll 😄

@gbjk gbjk force-pushed the feature/kraken_cancel_orders branch 2 times, most recently from ebf4876 to bc84123 Compare April 17, 2024 01:48
We were using the "cancel many" facility of the Kraken api.
However since that doesn't actually report errors individually, it seems
saner to just multiplex over it.
We were going to get N+ responses anyway. Might as well send N+ requests
@gbjk gbjk force-pushed the feature/kraken_cancel_orders branch from bc84123 to e7e5a5e Compare April 17, 2024 01:49
@thrasher- thrasher- merged commit c967d8a into thrasher-corp:master Apr 17, 2024
9 of 12 checks passed
@gbjk gbjk deleted the feature/kraken_cancel_orders branch August 23, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gcrc GloriousCode Review Complete review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants