Skip to content
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

Disable flashbots toggle on appropriate chains #5812

Merged
merged 6 commits into from
Jun 6, 2024
Merged

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Jun 4, 2024

Fixes APP-1560

What changed (plus any additional context for devs)

Screen recordings / screenshots

What to test

Copy link

linear bot commented Jun 4, 2024

@walmat walmat added the swaps v2 label Jun 4, 2024
@jinchung jinchung self-requested a review June 5, 2024 15:04
Copy link
Member

@jinchung jinchung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline

src/__swaps__/screens/Swap/components/AnimatedSwitch.tsx Outdated Show resolved Hide resolved
src/__swaps__/screens/Swap/components/ReviewPanel.tsx Outdated Show resolved Hide resolved
const checkIfFlashbotsIsEnabledOnSelectedInputAssetChain = (asset: ExtendedAnimatedAssetWithColors | null) => {
'worklet';

if (asset?.chainId === ChainId.mainnet) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to above (though we can remove this function anyway): don't like that we are re-introducing places in the code where we rely on these types of chainID checks vs relying on the source of truth (network config)

src/__swaps__/screens/Swap/hooks/useSwapSettings.ts Outdated Show resolved Hide resolved
Copy link
Member

@jinchung jinchung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌮

@jinchung
Copy link
Member

jinchung commented Jun 5, 2024

Testing scenarios: (@ibrahimtaveras00 )

  • default with mainnet asset -> review panel should show flashbots disabled but toggleable
  • switching to another mainnet asset -> flashbots disabled but toggleable
  • toggling flashbots on -> switching to another mainnet asset -> flashbots enabled and toggleable
  • switching to a non-mainnet asset -> flashbots disabled and not toggleable
  • switching to a mainnet asset -> flashbots enabled and toggleable
  • toggling flashbots off -> switching to another mainnet asset -> flashbots disabled and toggleable
  • switching to non-mainnet asset -> flashbots disabled and not toggleable
  • close the swaps flow -> come back to mainnet default -> flashbots disabled and toggleable
  • turn on flashbots -> close the swaps flow -> come back to mainnet default -> flashbots enabled and toggleable

@walmat walmat merged commit 984fabe into develop Jun 6, 2024
6 checks passed
@walmat walmat deleted the @matthew/APP-1560 branch June 6, 2024 15:17
BrodyHughes added a commit that referenced this pull request Jun 11, 2024
…ap-v2-e2e

* 'develop' of github.com:rainbow-me/rainbow:
  Fix weird issues with rounding  (#5822)
  Fix provider recursion bug, provider function types (#5829)
  bump braces (#5831)
  Add entry point for other networks (#5824)
  remove info icon on max transaction fee row as we don't have that in spec (#5827)
  [e2e] Add Malicious Dapp interaction test (#5764)
  reorg ens related calls (#5828)
  Performance: limit Sentry tracking, fix NFT hooks (#5819)
  fix wrong chainname (#5823)
  Disable flashbots toggle on appropriate chains (#5812)
  add type to SearchAsset type and add into type possibilities (#5820)
  fix fasterimage border radius android (#5816)
  more Safemath fixes (#5818)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants