-
Notifications
You must be signed in to change notification settings - Fork 186
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
feat: migrate limit orders to utilize redux for state management #8112
Conversation
src/state/slices/common/tradeInputBase/createTradeInputBaseSelectors.ts
Outdated
Show resolved
Hide resolved
8f43289
to
56645b2
Compare
756c0ee
to
2c0ee18
Compare
56645b2
to
2b14c3b
Compare
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.
Pretty straighforward, there is no so much risks tbh it's basically taking the trade input slices and make it reusable so we don't duplicate things limit order logic (I'm not saying that it's not a big amount of work, nicely done @woodenfurniture 🐐 )
Small review, pending runtime testing that I'm going to do right now
src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderRecipientAddress.tsx
Outdated
Show resolved
Hide resolved
src/components/MultiHopTrade/components/TradeInput/components/RecipientAddress.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.
✅ THORChain => ARB
https://jam.dev/c/794b1c7b-ae13-446c-829a-158f3316a8ce
✅ Li.Fi Multi hop
https://jam.dev/c/13233bb7-e02b-4457-8fd3-ab62cd6bd93d
✅ 0x single hop
https://jam.dev/c/2535485d-f872-4f3d-9359-1c4a54caaefb
✅ Portals swap with custom slippage (1.5%)
https://jam.dev/c/224ad78d-84df-40fc-bc18-ba402023114b
✅ Custom receive address
https://jam.dev/c/4a4765ad-f4c2-4ba1-b0e1-92b33153082f
General smoke test
Small visual issue, the centered content is sticked to the top (not blocking)
Learn more text is bigger than regular text
https://jam.dev/c/96b774bb-f0b8-46b3-9007-8c591cc9cb3d
Looks good to me!
4c915c8
to
ebc7b62
Compare
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.
Big chunky boy but actually a pretty straightforward change conceptually, big 🐐 on the higher-order slice/selectors as a concept ser that's actually a perfect and does avoid an almost 1/1 slice/selectors duplication here!
Runtime pass to follow.
src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderRecipientAddress.tsx
Show resolved
Hide resolved
...ltiHopTrade/components/SharedTradeInput/SharedTradeInputFooter/components/ReceiveSummary.tsx
Outdated
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.
Swapper regression test LGTM!
https://gist.github.com/gomesalexandre/3b653d55e9e722484b25325a6a293d4c
ebc7b62
to
fb8e778
Compare
Description
Migrates the WIP limit orders feature to utilize redux for state management. As the inputs of spot and limit trades are basically identical and contain extremely high risk code, a higher-order slice pattern has been adopted to deduplicate the logic and minimise surface area.
Also includes 2 fixes suggested by @NeOMakinG in #8095:
Issue (if applicable)
closes #8111
Risk
High risk. The migration to use of a new design pattern for trades means that although the core logic is left totally untouched, we should review and test this with extreme caution.
All trades for all protocols, specifically trade input (including receive address, slippage, everything).
Testing
A complete regression test of trades should be completed, including various inputs, configs, swappers, multi-hop, custom recipient, different accounts, etc.
Engineering
Operations
Screenshots (if applicable)
Swap via THORChain to manual receive address
Swap via LiFi to custom account number (#1) and custom slippage (1.5%)
Swap via CoW with custom slippage (1.5%)
Swap via 0x