-
Notifications
You must be signed in to change notification settings - Fork 385
Fix v3 behaviour when input or output token is ETH #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix v3 behaviour when input or output token is ETH #159
Conversation
Cool! I didn't get to do it, and it's pretty much what I had in mind! |
@@ -376,28 +395,27 @@ def make_trade( | |||
if slippage is None: | |||
slippage = self.default_slippage | |||
|
|||
if input_token == output_token: | |||
raise ValueError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe assert input_token != output_token
is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. Ran tests locally and works well!
A couple of unrelated tests failed, but that's my bad, and they're not testing anything important.
Fix for Uniswap v3 behaviour when ETH is the input or output token, resolving issues #154 and #155. There has also been some general tidying-up of parts of the code. Basic tests for all v3 scenarios have been run, but it would be good to check edge cases and verify that v1 and v2 still work as expected.