Check explicitly for order type in classified fees #283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an explicit check for order type instead of relying on checking tokens.
This should prevent regressions if we enable the case of orders with the sell token being equal to the buy token.
Rational
The code change is only affecting a part of the classified fees query which was ensuring backwards compatibility for missing network fee data. Then network fees had to be reconstructed differently for buy and sell orders. That part of the code will probably never be used for new orders with buy and sell token being equal. The changed code is, however, more explicit and prevents a regression if we should ever rely on that part of the code for new orders.
Testing
Since this change does not affect current data and produces the exact same results for two test weeks, merging it will be low risk.