Repository navigation
Conversation
Order creation uses these helpers when a size is below exchange limits. They had no direct tests. Co-authored-by: herklos.dev <herklos.dev@protonmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Thank you for sending your pull request.
But first, have you included unit tests, and is your code PEP8 conformant? More details
Summary
Add direct unit tests for the minimum order amount and cost helpers that gate order creation when a size is below exchange limits. Test-only change, no production code touched.
Solve the issue: none
Changelog
get_minimal_order_amount(exchange min, explicit zero, precision fallback, missing market)get_minimal_order_cost(exchange min, zero min ignored, caller price, market price min, missing market)What's new?
Nightly tests audit (aspect: tests missing for critical paths).
get_minimal_order_amountandget_minimal_order_costdecide whether an order is large enough for the exchange. Order creation calls them when adapted quantities are empty, and trading modes use them before placing orders. They had no direct tests.Scope is one new test file under
packages/trading/tests/personal_data/orders/. No existing test or source file is modified.Verification:
pytest packages/trading/tests/personal_data/orders/test_minimal_order_limits.py: 11 passed.packages/trading/standard.rc: 10.00/10.test_keeps_explicit_zero_min_amountfail. Source restored afterwards.python -m tools.extended_linter --base origin/dev: 0 violations.