e2e test that we drop vol. fee on ethflow native bridging order#4557
e2e test that we drop vol. fee on ethflow native bridging order#4557extrawurst wants to merge 3 commits into
Conversation
prove via extension of our existing e2e test
|
Claude finished @extrawurst's task in 4m 2s —— View job PR Review: e2e test that we drop vol. fee on ethflow native bridging order
This is a clean, well-targeted addition. It extends the existing ethflow native-bridge test to assert no volume fee is charged on a WETH → native-ETH (same-token) order, on both the quote ( What I verified:
One optional, non-blocking note posted inline: the test only asserts the absence of a fee, with no in-test positive control proving the fee would otherwise apply on this path (the ethflow order is No bugs or blocking issues found. |
There was a problem hiding this comment.
Code Review
This pull request updates the end-to-end ethflow tests to configure and verify that volume fees are not charged for same-token trades (specifically WETH to native ETH) on both quotes and settlements. No critical issues were found in these changes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| let trade = &services.get_trades(&uid).await.unwrap()[0]; | ||
| assert!( | ||
| trade.executed_protocol_fees.is_empty(), | ||
| "WETH->ETH ethflow trade must not be charged a volume fee, got {:?}", | ||
| trade.executed_protocol_fees | ||
| ); |
There was a problem hiding this comment.
Both assertions here (and the quote one above) check the absence of a fee, but nothing in this test proves the configured volume fee would otherwise apply on the ethflow path. If the wiring ever silently stopped charging the fee for an unrelated reason, this test would keep passing without exercising the same-token drop it's meant to guard.
Concretely, the volume policy only applies to OrderClass::Limit orders (autopilot/src/domain/fee/policy.rs:92-104), and the ethflow order is classified Limit only because its fee_amount is zero (onchain_order_events/mod.rs:627-630). So the drop being tested is one of two reasons the fee could be absent.
This is a low risk in practice — volume_fee_dropped_on_same_token in protocol_fee.rs already pairs the same-token drop with a different-token positive control, and the underlying get_applicable_volume_fee_factor is unit-tested for BUY_ETH_ADDRESS. So I'd treat this as optional, but a one-line note pointing at the existing positive-control test (or a brief comment that the Limit classification is what makes this non-vacuous) would make the regression intent more robust to future changes.
As a followup to #4531.
This adds a bit to our ethflow native bridging test to regression proof us dropping the volume fee on these type of trades.
for context see slack