thrasher-corp / gocryptotrader

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

request/nonce: simplify and prevent two consecutive mutex lock calls #1506

Closed shazbert closed 3 months ago

shazbert commented 4 months ago

PR Description

Requires #1486

Attempts to improve flow when deriving a nonce.

Fixes # (issue)

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

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.

Checklist

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 37.83%. Comparing base (5b2251b) to head (0baf92c). Report is 1 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506/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/1506?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 #1506 +/- ## ========================================== + Coverage 35.96% 37.83% +1.86% ========================================== Files 411 411 Lines 177329 147507 -29822 ========================================== - Hits 63773 55804 -7969 + Misses 105782 83919 -21863 - Partials 7774 7784 +10 ``` | [Files](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) | Coverage Δ | | |---|---|---| | [exchanges/bitstamp/bitstamp.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fbitstamp%2Fbitstamp.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2JpdHN0YW1wL2JpdHN0YW1wLmdv) | `82.14% <100.00%> (+2.91%)` | :arrow_up: | | [exchanges/gemini/gemini.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fgemini%2Fgemini.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2dlbWluaS9nZW1pbmkuZ28=) | `75.49% <100.00%> (+3.92%)` | :arrow_up: | | [exchanges/nonce/nonce.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fnonce%2Fnonce.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL25vbmNlL25vbmNlLmdv) | `100.00% <100.00%> (ø)` | | | [exchanges/poloniex/poloniex.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fpoloniex%2Fpoloniex.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3BvbG9uaWV4L3BvbG9uaWV4Lmdv) | `41.63% <100.00%> (+3.20%)` | :arrow_up: | | [exchanges/alphapoint/alphapoint.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Falphapoint%2Falphapoint.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2FscGhhcG9pbnQvYWxwaGFwb2ludC5nbw==) | `11.29% <0.00%> (+0.44%)` | :arrow_up: | | [exchanges/bitfinex/bitfinex.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fbitfinex%2Fbitfinex.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2JpdGZpbmV4L2JpdGZpbmV4Lmdv) | `28.05% <0.00%> (+1.82%)` | :arrow_up: | | [exchanges/exmo/exmo.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fexmo%2Fexmo.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2V4bW8vZXhtby5nbw==) | `36.42% <0.00%> (+1.26%)` | :arrow_up: | | [exchanges/kraken/kraken.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fkraken%2Fkraken.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2tyYWtlbi9rcmFrZW4uZ28=) | `56.40% <0.00%> (+1.18%)` | :arrow_up: | | [exchanges/yobit/yobit.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Fyobit%2Fyobit.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3lvYml0L3lvYml0Lmdv) | `61.38% <0.00%> (+0.01%)` | :arrow_up: | | [exchanges/request/request.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506?src=pr&el=tree&filepath=exchanges%2Frequest%2Frequest.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3JlcXVlc3QvcmVxdWVzdC5nbw==) | `74.45% <37.50%> (+4.85%)` | :arrow_up: | ... and [378 files with indirect coverage changes](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1506/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)