thrasher-corp / gocryptotrader

A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.
MIT License
2.98k stars 799 forks source link

Kucoin: Add subscription templating and various fixes #1579

Closed gbjk closed 3 weeks ago

gbjk commented 1 month ago

Kucoin

Stacked Dependencies

Type of change

How has this been tested

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 90.06024% with 33 lines in your changes missing coverage. Please review.

Project coverage is 36.32%. Comparing base (d1e3669) to head (7c3d7fb). Report is 6 commits behind head on master.

Files Patch % Lines
exchanges/kucoin/kucoin_websocket.go 87.86% 14 Missing and 7 partials :warning:
exchanges/btcmarkets/btcmarkets_wrapper.go 0.00% 9 Missing :warning:
common/common.go 87.50% 2 Missing and 1 partial :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579/graphs/tree.svg?width=650&height=150&src=pr&token=41784B23TS&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) ```diff @@ Coverage Diff @@ ## master #1579 +/- ## ========================================== - Coverage 38.20% 36.32% -1.89% ========================================== Files 421 422 +1 Lines 152345 183014 +30669 ========================================== + Hits 58204 66480 +8276 - Misses 86072 108483 +22411 + Partials 8069 8051 -18 ``` | [Files](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) | Coverage Δ | | |---|---|---| | [currency/manager.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=currency%2Fmanager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-Y3VycmVuY3kvbWFuYWdlci5nbw==) | `94.01% <100.00%> (-0.96%)` | :arrow_down: | | [currency/pairs.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=currency%2Fpairs.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-Y3VycmVuY3kvcGFpcnMuZ28=) | `96.28% <100.00%> (-0.80%)` | :arrow_down: | | [exchanges/asset/asset.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Fasset%2Fasset.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2Fzc2V0L2Fzc2V0Lmdv) | `93.70% <ø> (+0.25%)` | :arrow_up: | | [exchanges/exchange.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Fexchange.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2V4Y2hhbmdlLmdv) | `76.64% <100.00%> (-3.08%)` | :arrow_down: | | [exchanges/kucoin/kucoin.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Fkucoin%2Fkucoin.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2t1Y29pbi9rdWNvaW4uZ28=) | `14.58% <100.00%> (-1.06%)` | :arrow_down: | | [exchanges/kucoin/kucoin\_types.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Fkucoin%2Fkucoin_types.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2t1Y29pbi9rdWNvaW5fdHlwZXMuZ28=) | `60.86% <ø> (-3.95%)` | :arrow_down: | | [exchanges/kucoin/kucoin\_wrapper.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Fkucoin%2Fkucoin_wrapper.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2t1Y29pbi9rdWNvaW5fd3JhcHBlci5nbw==) | `34.51% <100.00%> (-3.20%)` | :arrow_down: | | [exchanges/orderbook/orderbook.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Forderbook%2Forderbook.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL29yZGVyYm9vay9vcmRlcmJvb2suZ28=) | `90.43% <100.00%> (-1.84%)` | :arrow_down: | | [exchanges/subscription/list.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Fsubscription%2Flist.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3N1YnNjcmlwdGlvbi9saXN0Lmdv) | `100.00% <100.00%> (ø)` | | | [exchanges/subscription/template.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree&filepath=exchanges%2Fsubscription%2Ftemplate.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3N1YnNjcmlwdGlvbi90ZW1wbGF0ZS5nbw==) | `100.00% <100.00%> (+2.81%)` | :arrow_up: | | ... and [3 more](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) | | ... and [386 files with indirect coverage changes](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1579/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)
gbjk commented 1 month ago

Tests fixed. Can't and shouldn't cache a compiled template closuring anything on Kucoin itself. Not a hot enough path to justify caching at all really though.

shazbert commented 4 weeks ago

Also there is a CI test issue: here

gbjk commented 4 weeks ago

Also there is a CI test issue: here

🤦 Thanks. Sorry I didn't spot that.

Fixed 857ac7ad

gbjk commented 4 weeks ago

Squashed down for final review 😄 Zero changes in the squash though.