gocryptotrader
gocryptotrader copied to clipboard
exchanges: abstract websocket/REST orderbook initial update code from wrapper to exchanges package.
PR Description
- Abstracts majority of code that handles initial snapshot updates fetched via REST
- Consolidates changes to Binance only for
review+testingbefore all exchange conversion - Considered putting everything
under the hoodin stream package; but this is easy for first demonstration. Eventually will consolidate a lot of duplicated code.
Type of change
Please delete options that are not relevant and add an x in [] as item is complete.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
How has this been tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and also consider improving test coverage whilst working on a certain feature or package.
- [ ] go test ./... -race
- [ ] golangci-lint run
- [ ] Test X
Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally and on Github Actions with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
Codecov Report
Attention: Patch coverage is 73.60595% with 71 lines in your changes are missing coverage. Please review.
Project coverage is 35.88%. Comparing base (
4cd4fb0) to head (0f4be56).
Additional details and impacted files
@@ Coverage Diff @@
## master #1481 +/- ##
==========================================
- Coverage 37.80% 35.88% -1.92%
==========================================
Files 409 411 +2
Lines 147712 177260 +29548
==========================================
+ Hits 55841 63616 +7775
- Misses 84005 105792 +21787
+ Partials 7866 7852 -14
| Files | Coverage Δ | |
|---|---|---|
| exchanges/binance/binance.go | 45.19% <ø> (-3.13%) |
:arrow_down: |
| exchanges/binanceus/binanceus_websocket.go | 43.94% <100.00%> (-3.32%) |
:arrow_down: |
| exchanges/btcmarkets/btcmarkets_websocket.go | 39.63% <100.00%> (-3.76%) |
:arrow_down: |
| exchanges/bybit/bybit_websocket.go | 46.81% <100.00%> (-3.99%) |
:arrow_down: |
| exchanges/coinut/coinut_websocket.go | 25.79% <100.00%> (-2.18%) |
:arrow_down: |
| exchanges/hitbtc/hitbtc_websocket.go | 25.42% <100.00%> (-2.84%) |
:arrow_down: |
| exchanges/kucoin/kucoin_websocket.go | 54.26% <100.00%> (-4.32%) |
:arrow_down: |
| exchanges/orderbook/depth.go | 100.00% <100.00%> (ø) |
|
| exchanges/poloniex/poloniex_websocket.go | 50.79% <100.00%> (-3.26%) |
:arrow_down: |
| exchanges/stream/buffer/buffer.go | 65.93% <100.00%> (-3.34%) |
:arrow_down: |
| ... and 3 more |