fix: consolidate matching buy account id selection logic#6268
Merged
gomesalexandre merged 3 commits intoreleasefrom Feb 21, 2024
Merged
fix: consolidate matching buy account id selection logic#6268gomesalexandre merged 3 commits intoreleasefrom
gomesalexandre merged 3 commits intoreleasefrom
Conversation
woodenfurniture
commented
Feb 21, 2024
woodenfurniture
commented
Feb 21, 2024
src/components/MultiHopTrade/hooks/useGetTradeQuotes/useGetTradeQuotes.tsx
Show resolved
Hide resolved
woodenfurniture
commented
Feb 21, 2024
0xApotheosis
approved these changes
Feb 21, 2024
Member
0xApotheosis
left a comment
There was a problem hiding this comment.
This will need further ops testing, but I can no longer replicate the issue in release.
Further:
✅ Accounts are synced on Trade component initialization
❔ Accounts are not synced on asset change, but instead retain their previous account number. This is not a bug per se, as the requirements on the desired behaviour here aren't clear/known.
✅ The buy asset account correctly defaults to account 0 when no account matching the sell asset is found
✅ The initial sell asset account is the highest balance account for the sell asset
gomesalexandre
approved these changes
Feb 21, 2024
0xApotheosis
added a commit
that referenced
this pull request
Feb 21, 2024
* fix: trades from native assets & utxos (#6260) fix: native allowance * fix: use correct chain id for matching buy account * fix: allow quote sell amounts to be lower than user input sell amount (#6265) * fix: allow quote sell amounts to be lower than user input sell amount * fix: fix logic, add a teeny tiny thrshold so cowswap works * fix: consolidate matching buy account id selection logic (#6268) * chore: fix merge --------- Co-authored-by: kaladinlight <[email protected]> Co-authored-by: woody <[email protected]>
gomesalexandre
pushed a commit
that referenced
this pull request
Feb 22, 2024
* fix: trades from native assets & utxos (#6260) fix: native allowance * fix: use correct chain id for matching buy account * fix: allow quote sell amounts to be lower than user input sell amount (#6265) * fix: allow quote sell amounts to be lower than user input sell amount * fix: fix logic, add a teeny tiny thrshold so cowswap works * fix: consolidate matching buy account id selection logic (#6268) * chore: fix merge --------- Co-authored-by: kaladinlight <[email protected]> Co-authored-by: woody <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Follows up on #6263 which fixed some issue with matching buyAccountId logic, but still had an issue where quotes are not fetched when selecting AVAX as the sell asset, due to incorrect default buy account being selected based on the incorrect chain ID.
3 fixes to buy account ID selection:
chainIdPull Request Type
Issue (if applicable)
unblocks release #6257
Risk
High risk, modifies account selection.
Testing
Engineering
Operations
Screenshots (if applicable)
Release - no quotes being fetched:

Local - quotes now get fetched:

Last resort default is now account 0 for buy account (not

highest_balance_account ?? account_0):