rainbow-me / rainbow

🌈‒ the Ethereum wallet that lives in your pocket
https://rainbow.me
GNU General Public License v3.0
3.95k stars 627 forks source link

convert network accessors to functions #6219

Open walmat opened 1 month ago

walmat commented 1 month ago

What changed (plus any additional context for devs)

Okay so runtime support wasn't working because our accessors for backendNetworks data were all objects that only read from queryData once and never again on successive calls. I've converted all the accessors to be functions, so now we read up-to-date information when accessing.

Intro: backendNetworksStore.

This PR also introduces a couple worklet functions to make swaps behave nicely. The only caveat is for the worklet functions, you must pass the backend network data in as a parameter. This is necessary because we cannot call getState inside of a worklet.

Screen recordings / screenshots

N/A as it's just functional changes

What to test

Test all critical paths

would be nice to be able to coordinate some backend change to see them reflected in real-time

brunobar79 commented 1 month ago

Launch in simulator or device for 215ea07d0c491555881cd94fd7f987854088faca

brunobar79 commented 1 month ago

Launch in simulator or device for f751ea82a1950491bcbd958f06467ceb2bd494be