e2e test proving pre hook run on same token trade#4490
Merged
Conversation
proving actual sell=buy use case to facilitate it to arb interactions on a same token trade
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds an end-to-end test to verify that a solver pays for a pre-hook execution on a same-token buy order when SameTokensPolicy::Allow is enabled. No critical issues found.
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.
MartinquaXD
approved these changes
Jun 5, 2026
Contributor
MartinquaXD
left a comment
There was a problem hiding this comment.
Seems reasonable to have a dedicated test for this.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Adds a use-case-driven e2e test for same-token orders (
SameTokensPolicy::Allow, #3963).Follow-up to #4463, which proved buy-side support with WETH→ETH (native-equivalent, not a
literal same token). This uses WETH→WETH and the real use case: a no-op same-token
trade used to get a pre-hook executed and paid for by the solver.
Changes
Add
local_node_solver_pays_for_pre_hook_on_same_token_order:SameTokensPolicy::Allow, WETH→WETHBuyorder with a 1% spread (the solver's headroomto cover settlement gas + the hook).
Countertest contract; we assert it ran.Asserts: counter
0before; settlement tx confirmed (not a cancellation); counter1after (hook ran); trader WETH balance decreased (paid the spread).
How to test