-
Notifications
You must be signed in to change notification settings - Fork 249
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(wallet)_: preserve value for token swaps to properly form path key #6058
Conversation
Jenkins Builds
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6058 +/- ##
===========================================
- Coverage 60.87% 60.84% -0.04%
===========================================
Files 811 811
Lines 108894 108894
===========================================
- Hits 66293 66258 -35
- Misses 34843 34875 +32
- Partials 7758 7761 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -164,7 +164,8 @@ func (tm *TransactionManager) buildTxForPath(path *routes.Path, pathProcessors m | |||
|
|||
// special handling for transfer tx if selected token is not ETH | |||
// TODO: we should fix that in the trasactor, but till then, the best place to handle it is here | |||
if !path.FromToken.IsNative() { | |||
// Paraswap needs the value to form the path key | |||
if path.ProcessorName != pathprocessor.ProcessorSwapParaswapName && !path.FromToken.IsNative() { |
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.
@dlipicar based on what I see here we have the same issue for bridging other than ETH tokens.
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.
This issue started after we've added Amount
to the key (under which we're storing some data for processors) to increase the uniqueness and fix the bridging issue.
Will try to think now about how to fix it globally.
Could we close this PR in favour of this one #6059? |
Value was getting set to 0 for the Paraswap processor. This would normally not be a problem since that value isn't used for actually building the transaction, but since the amount is now used to form the key in the paths map, this caused the path not to be found for swaps with input token different than ETH.
We now preserve the value.
Fixes status-im/status-mobile#21555