Buy orders with same sell buy token#4274
Buy orders with same sell buy token#4274ashleychandy wants to merge 4 commits intocowprotocol:mainfrom
Conversation
|
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
|
Hello @ashleychandy, thank You for Your contribution. I will review it thoroughly and we will either work together to ensure a smooth review or I might take over it to incorporate into a PR I am already working on. Will reach back to You tomorrow. |
… same token validation Add tests for same sell and buy token validation in order processing
fafce0b to
029fc4b
Compare
|
Hey @m-sz, I’ve just pushed a small refactor to the validate_same_sell_and_buy_token logic along with some additional test coverage to make the behavior clearer and easier to reason about. Happy to iterate based on your feedback, or if it fits better with your ongoing PR, I’m also fine with you incorporating the changes there. Just let me know how you’d prefer to proceed. |
Description
Enable sell=buy handling for native-equivalent trades by treating native wrapped token to ETH marker as same-token during order validation.
This is needed because the conversion path already exists downstream, but validation previously rejected these orders early.
Changes
How to test
cargo nextest run -p shared pre_validate_err pre_validate_same_tokens_allow_sellcargo nextest run -p e2e local_node_native_same_token_sell_with_eth_buy_marker local_node_native_same_token_buy_with_eth_buy_marker_rejected --test-threads 1 --run-ignored ignored-only --failure-output finalRelated Issues
Fixes #4053