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.