thrasher-corp / gocryptotrader

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

currency: Make pairs.Add variadic #1566

Closed cranktakular closed 2 months ago

cranktakular commented 3 months ago

PR Description

Alters the Add method on currency.Pairs to accept an arbitrary amount of Pair objects as input, to enable mass-scale safe adding of pairs, in a way that hopefully doesn't break code that currently uses this function.

Type of change

How has this been tested

Checklist

cranktakular commented 3 months ago

Implementation overhaul risks breaking uses of this function, but as far as I can tell I didn't cause any new issues.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 38.15%. Comparing base (98f025e) to head (5dd69ea). Report is 10 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1566/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/1566?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 #1566 +/- ## ========================================== + Coverage 36.26% 38.15% +1.88% ========================================== Files 419 420 +1 Lines 183133 152322 -30811 ========================================== - Hits 66421 58114 -8307 + Misses 108605 86137 -22468 + Partials 8107 8071 -36 ``` | [Files](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1566?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/pairs.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1566?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=) | `97.08% <100.00%> (+0.80%)` | :arrow_up: | | [exchanges/sharedtestvalues/sharedtestvalues.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1566?src=pr&el=tree&filepath=exchanges%2Fsharedtestvalues%2Fsharedtestvalues.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3NoYXJlZHRlc3R2YWx1ZXMvc2hhcmVkdGVzdHZhbHVlcy5nbw==) | `67.94% <100.00%> (+6.94%)` | :arrow_up: | | [exchanges/subscription/subscription.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1566?src=pr&el=tree&filepath=exchanges%2Fsubscription%2Fsubscription.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3N1YnNjcmlwdGlvbi9zdWJzY3JpcHRpb24uZ28=) | `100.00% <100.00%> (+4.16%)` | :arrow_up: | ... and [396 files with indirect coverage changes](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1566/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)