davesag / ir-api

A NodeJS Client for Independent Reserve's API
MIT License
6 stars 6 forks source link

[BUG, issue #770] remove validation on txTypes for getTransactions #772

Closed omniwolf closed 4 months ago

omniwolf commented 4 months ago

The code attempts to validate transaction types, which unnecessarily limits the module now.

Defining the allowable transaction types isn't the right way to do this either - it will just cause issues going forward. If we remove validation, and the dev requests a txType that doesn't exist, the code fails just as before. Adding validation in this wrapper doesn't add anything (except it does hide the actual error with a vague "Validation error" message).

Removing this line fixes two issues:

  1. Incorrect "isRequired" validation - txTypes is not a mandatory parameter
  2. Incorrect txTypes options subset - there are many more transaction types than Brokerage and Trade. See here: https://github.com/independentreserve/dotNetApiClient/blob/b314952ef35ca65758bd826e2b735d33ca227e1f/src/DotNetClientApi/Data/TransactionType.cs#L12

https://github.com/davesag/ir-api/issues/770

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 100.00%. Comparing base (fa6639b) to head (76644ab).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #772 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 63 63 Lines 577 576 -1 ========================================= - Hits 577 576 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.