Hi,
while looking through the current starknet branch, I noticed that the tests under tests/perpetual/order_object/ seem to cover the happy-path construction/serialization cases, but not the invalid-input validation branches in x10/perpetual/order_object.py.
A few examples of rules that are currently enforced in code:
- MARKET orders must use
time_in_force=IOC
- MARKET orders must not be post-only
- CONDITIONAL orders must include
trigger
- TPSL orders must be reduce-only
- TPSL orders must not be post-only
- POSITION TPSL orders must use
synthetic_amount=0
- TPSL orders must use
price=0
tp_sl_type is required when take_profit or stop_loss is provided
It looks like a small tests-only PR could add pytest.raises(...) coverage for these existing checks without changing behavior.
If this direction makes sense, I can put together a narrow regression-test PR.
Hi,
while looking through the current
starknetbranch, I noticed that the tests undertests/perpetual/order_object/seem to cover the happy-path construction/serialization cases, but not the invalid-input validation branches inx10/perpetual/order_object.py.A few examples of rules that are currently enforced in code:
time_in_force=IOCtriggersynthetic_amount=0price=0tp_sl_typeis required whentake_profitorstop_lossis providedIt looks like a small tests-only PR could add
pytest.raises(...)coverage for these existing checks without changing behavior.If this direction makes sense, I can put together a narrow regression-test PR.