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

Refactor: minimize the usage of the static chains config #1692

Merged
merged 6 commits into from
Mar 13, 2023
Merged

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Feb 23, 2023

What it solves

New chains are popping up like mushrooms and the static chainId<->shortName config becomes a hurdle when adding new chain support via the config service.

I removed all the places where looking up a shortName in the static config was blocking the UI if the chain isn't there.

useChainId still relies on the static config to resolve a shortName from the URL faster, but it will now also look it up in the remote config. This means that loading a page on a chain that isn't in the config will redirect to the default chain (because the remote chains wouldn't be loaded instantly), but navigating to that chain via the menu will be still possible.

How to test

Test opening different chains, and also reloading the page on a given chain.

@github-actions
Copy link

github-actions bot commented Feb 23, 2023

Branch preview

✅ Deploy successful!

https://chains--webcore.review-web-core.5afe.dev

@github-actions
Copy link

github-actions bot commented Feb 23, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@katspaugh katspaugh marked this pull request as draft February 23, 2023 09:15
@katspaugh katspaugh marked this pull request as ready for review February 24, 2023 08:05
@katspaugh
Copy link
Member Author

katspaugh commented Feb 24, 2023

@iamacook I've also removed our config and use that from safe-core-sdk-utils instead. It's better because it's now consistent with the Core SDK's chain support which we depend on already.
And Safe Core SDK's chain support is in turn consistent with safe-deployments because it checks for missing chains during the build (pretty neat!).

Co-authored-by: Aaron Cook <aaron@safe.global>
@francovenica
Copy link
Contributor

LGTM

Being switching networks around, switching between safes, checking the switching the network in the safe creation, checking the "switch to x network" button when the wallet is in the wrong network.

@katspaugh katspaugh merged commit ecc428d into dev Mar 13, 2023
@katspaugh katspaugh deleted the chains branch March 13, 2023 05:43
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants