fix: show networkFeeError at trade confirm#12192
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
NeOMakinG
left a comment
There was a problem hiding this comment.
QA Review (Code Review) ✅
Changes reviewed:
-
TradeConfirmFooter.tsx: Extracts
errorfromuseTradeNetworkFeeCryptoBaseUnithook and passes it to TradeFooterButton -
TradeFooterButton.tsx:
- Adds
networkFeeErrorprop with proper typing - Creates
networkFeeErrorMessagememo that handles both ChainAdapterError (with translation) and generic errors - Displays warning alert when network fee estimation fails
- Disables confirm button when error present
- Changes button color to red to indicate error state
- Adds
Assessment:
Clean implementation that properly surfaces gas estimation failures to users. Previously the button would remain enabled even when gas estimation failed, leading to confusing UX and failed transactions. Now users see a clear warning and cannot proceed with a broken trade.
Tested: Code review only (wallet import issues prevented live testing)
LGTM 👍
Description
Trade confirm was silently failing on gas estimation and not disabling the button resulting in failed attempt to trade. Expose the error and disable the button if we can't estimate gas.
Follow up if we wish would be falling back to the quote estimated fees and just fetch up to date gas price on execute.
Issue (if applicable)
https://discordapp.com/channels/554694662431178782/1483584545369620523/1483591857739927552
Risk
Low
Testing
Engineering
☝️
Operations
☝️
Screenshots (if applicable)