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

Fix provider recursion bug, provider function types #5829

Merged
merged 4 commits into from
Jun 11, 2024

Conversation

christianbaroni
Copy link
Member

Fixes APP-1567

What changed (plus any additional context for devs)

  • Fixes an issue where getProviderForNetwork was being repeatedly called throughout the app, for every network, due to the getProvider function within the network objects being invoked any time getNetworkObj or getXNetworkObj was invoked
    • Additionally, when getProviderForNetwork was called for a not-yet-cached network, the calling of getNetworkObj from within getProviderForNetwork would then again call getProviderForNetwork due to getProvider within the network object being invoked, leading to a recursive loop that would run until the provider eventually made it into the cache
  • Fixes the return types of the getProviderForNetwork and getCachedProviderForNetwork functions
  • Adds a getIsHardhatConnected helper function

Screen recordings / screenshots

What to test

Copy link

linear bot commented Jun 7, 2024

@jinchung jinchung added swaps v2 performance performance related improvements labels Jun 8, 2024
src/handlers/web3.ts Outdated Show resolved Hide resolved
@christianbaroni christianbaroni merged commit 7cdcc7a into develop Jun 11, 2024
6 checks passed
@christianbaroni christianbaroni deleted the @christian/fix-provider-bugs branch June 11, 2024 03:15
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
performance performance related improvements swaps v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants