-
Notifications
You must be signed in to change notification settings - Fork 192
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: store Orbit chains as json #1665
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is the removed orbitChainsList.ts
file (and renamed) and Orbit chains are removed from here. These chains are now part of json configs.
…e into store-orbits-json
…token-bridge into store-orbits-json
…e into store-orbits-json
@@ -0,0 +1,304 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check that I didn't miss an Orbit chain while migrating, because I was resolving some conflicts too.
Also, pls compare old data against the new.
.refine(bool => bool === true, 'Invalid input, must be true') | ||
|
||
function validateOrbitChain(chain: OrbitChainConfig) { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that we're validating this in prebuild, we want it to throw when there's an error, so let's remove try/catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we throw in the catch block, we just want to show info about the chain name/ID first
…e into store-orbits-json
…e into store-orbits-json
…e into store-orbits-json
…e into store-orbits-json
…e into store-orbits-json
typeof getOrbitChains({ | ||
mainnet: true, | ||
testnet: false | ||
}).find(chain => chain.chainId === chainId) !== 'undefined' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less performant than the previous implementation but I feel like we shouldn't export both orbit objects and a getter function and have less consistent codebase.
We work with small lists so using find
here should be fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally our ArbitrumNetwork should have a testnet
flag. That would simplify isNetwork
itself as well
…e into store-orbits-json
A requirement for #1664. Need to store Orbit chains as json so that the workflow can easily update it.