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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion services/wallet/transfer/transaction_manager_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

sendArgs.Value = (*hexutil.Big)(big.NewInt(0))

if path.ProcessorName == pathprocessor.ProcessorTransferName ||
Expand Down