gocryptotrader icon indicating copy to clipboard operation
gocryptotrader copied to clipboard

exchanges/order: Added TimeInForce type and values

Open samuael opened this issue 1 year ago • 3 comments

ሰላም፣ ወንድሞች

PR Description

This PR adds a type TimeInForce(TIF) to represent common Time In Force values. It affects some exchanges and packages that were using the ImmediateOrCancel and FillOrKill values. Units that were affected by the change are tested. Additionally, new unit tests are added for newly added functions.

Exchanges that are directly affected by the change are Binance, Bitrex, BTCMarket, CoinbasePro, Huobi, Kraken, Poloniex

Packages affected: Orders, Engine, cmd/exchange_wrapper_standards

Fixes # (issue)

Type of change

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

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [x] 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.

  • [x] go test ./... -race
  • [x] golangci-lint run
  • [x] Test X

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented on my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • [x] My changes generate no new warnings
  • [x] 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/AppVeyor with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

samuael avatar Oct 29 '23 18:10 samuael

Sorry for the delayed update on this PR. I think I have added all the required updates.

samuael avatar Nov 15 '23 11:11 samuael

The endpoints I can run are only those that are public. The change I made, TimeInForce is mostly used by the authenticated, order-related endpoints.

I am open to hear any other alternative of running the authenticated tests you may suggest

samuael avatar Dec 06 '23 18:12 samuael

Codecov Report

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

Project coverage is 37.73%. Comparing base (d679a76) to head (3aa605a). Report is 3 commits behind head on master.

:exclamation: Current head 3aa605a differs from pull request most recent head b453062. Consider uploading reports for the commit b453062 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1382      +/-   ##
==========================================
+ Coverage   35.89%   37.73%   +1.84%     
==========================================
  Files         411      411              
  Lines      177595   147714   -29881     
==========================================
- Hits        63752    55746    -8006     
+ Misses     106058    84191   -21867     
+ Partials     7785     7777       -8     
Files Coverage Δ
engine/order_manager.go 67.21% <100.00%> (+1.73%) :arrow_up:
exchanges/binance/binance.go 48.32% <100.00%> (+3.12%) :arrow_up:
exchanges/btcmarkets/btcmarkets.go 25.21% <100.00%> (+1.07%) :arrow_up:
exchanges/coinbasepro/coinbasepro.go 41.08% <100.00%> (+2.63%) :arrow_up:
exchanges/kraken/kraken.go 56.40% <100.00%> (+1.18%) :arrow_up:
exchanges/order/orders.go 90.40% <100.00%> (-0.33%) :arrow_down:
exchanges/poloniex/poloniex_wrapper.go 42.89% <100.00%> (+4.30%) :arrow_up:
exchanges/huobi/huobi_wrapper.go 41.81% <0.00%> (+2.54%) :arrow_up:
exchanges/binance/binance_wrapper.go 41.12% <33.33%> (+2.89%) :arrow_up:
exchanges/coinbasepro/coinbasepro_wrapper.go 39.77% <60.00%> (+3.34%) :arrow_up:
... and 2 more

... and 376 files with indirect coverage changes

codecov[bot] avatar Feb 28 '24 18:02 codecov[bot]