-
Notifications
You must be signed in to change notification settings - Fork 191
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: consolidate matching buy account id selection logic #6268
Conversation
src/components/MultiHopTrade/hooks/useGetTradeQuotes/useGetTradeQuotes.tsx
Show resolved
Hide resolved
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 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
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.
* 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]>
* 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]>
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:
chainId
Pull 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
):