Increase default slippage from 2% to 3%, show Advanced Options by default#10842
Increase default slippage from 2% to 3%, show Advanced Options by default#10842danjm merged 5 commits intoMetaMask:developfrom dan437:swaps-slippage
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
This change looks good, but actually reveals a pre-existing bug that I think should be addressed within this PR. To see this bug on this branch:
I've attached a file that shows a change that resolves that problem: However, there will still be a similar problem if a custom amount is entered. That should be resolved too, I think. |
danjm
left a comment
There was a problem hiding this comment.
One small issue to address, otherwise this code looks good
There was a problem hiding this comment.
I think it might be best not to call setCustomValue in the callback to useState, as this is incidental to the purpose of this function. I think the intent of the code would be clearer if we added a callback to the useState call that sets up the customValue which would set the initial custom value to currentSlippage if currentSlippage is truthy but not equal to 2 or 3.
Explanation:
Manual testing steps:
Swapbutton in the MetaMask extensionSwappage with Advanced Options visible and 3% slippage tolerance selected by defaultScreenshots:
Swap page: Advanced Options visible and 3% slippage tolerance selected by default

Verifying that the 3% slippage is send to the server:

Pre-popullating previously set custom value when going back to the Swap page:

All unit tests are green:
