Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

dlipicar
Copy link
Contributor

@dlipicar dlipicar commented Nov 7, 2024

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

@status-im-auto
Copy link
Member

status-im-auto commented Nov 7, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c8c5c41 #1 2024-11-07 03:30:35 ~4 min tests-rpc 📄log
✔️ c8c5c41 #1 2024-11-07 03:31:06 ~5 min macos 📦zip
✔️ c8c5c41 #1 2024-11-07 03:31:17 ~5 min macos 📦zip
✔️ c8c5c41 #1 2024-11-07 03:31:25 ~5 min linux 📦zip
✔️ c8c5c41 #1 2024-11-07 03:31:25 ~5 min android 📦aar
✔️ c8c5c41 #1 2024-11-07 03:31:44 ~5 min windows 📦zip
✔️ c8c5c41 #1 2024-11-07 03:32:02 ~6 min ios 📦zip
✔️ c8c5c41 #1 2024-11-07 04:00:25 ~34 min tests 📄log

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 60.84%. Comparing base (f15c64c) to head (c8c5c41).

Files with missing lines Patch % Lines
...vices/wallet/transfer/transaction_manager_route.go 0.00% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
functional 13.08% <0.00%> (-0.02%) ⬇️
unit 60.21% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...vices/wallet/transfer/transaction_manager_route.go 41.58% <0.00%> (ø)

... and 23 files with indirect coverage changes

@@ -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() {
Copy link
Contributor

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.

Copy link
Contributor

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.

@saledjenic
Copy link
Contributor

Could we close this PR in favour of this one #6059?

@dlipicar dlipicar closed this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERC20 bridge and swap transactions are broken
4 participants