Implement tiers and checks for networks#362
Conversation
| .filter(|&n| { | ||
| HypersyncNetwork::iter() | ||
| //able to cast as u64 because networks enum | ||
| //uses repr(u64) attribute | ||
| .find(|&sn| n as u64 == sn as u64) | ||
| .is_some() | ||
| }) |
There was a problem hiding this comment.
Hmm, I thought I deleted the code. Looks like I missed the place 👍
| match self { | ||
| EthereumMainnet | Fantom | Zeta | Sepolia | OptimismSepolia | Metis | ZksyncEra | ||
| | Optimism | ArbitrumSepolia | ArbitrumNova | Avalanche | Polygon | Bsc | Mantle | ||
| | Zircuit | BaseSepolia => Gold, | ||
|
|
||
| Manta | Base | BerachainBartio | Boba | Blast | Cyber | Aurora | Harmony | Scroll | ||
| | Darwinia | Mode | Rsk | ShimmerEvm | Linea | NeonEvm | Amoy | Saakuru | Moonbeam | ||
| | Opbnb | Lisk | BlastSepolia | Celo | Chiliz | Fuji | ArbitrumOne | Merlin | ||
| | Holesky => Silver, | ||
|
|
||
| Zora | MoonbaseAlpha | Morph | LuksoTestnet | Kroma | GnosisChiado | XLayer | Lukso | ||
| | Gnosis | C1Milkomeda | Crab | Tangle | Sophon | Flare | PolygonZkevm | MevCommit => { | ||
| Bronze | ||
| } | ||
|
|
||
| SophonTestnet | MorphTestnet | GaladrielDevnet | CitreaTestnet | Goerli | ||
| | BscTestnet | B2Testnet | UnichainSepolia => Experimental, |
There was a problem hiding this comment.
Should we maybe store the json file and compute the values from it in runtime?
I think it's going to be annoying to sync the list. Also, we can do the same for whether chain is hypersync or not + add a make script to update the json file.
There was a problem hiding this comment.
TBH we should probably just compute everything dynamically from the API.
But otherwise yeah, json file could be better.
We could get rid of our network enum entirely.
There was a problem hiding this comment.
Would like to add things like the default confirmed block threshold to the API
There was a problem hiding this comment.
Yeah, that would be great. But inline the file to binary, instead of fetching from the server on every run
There was a problem hiding this comment.
But we also have non-hypersync chains there, so I'm not really sure
| let options = NetworkWithExplorer::iter() | ||
| //Filter only our supported networks | ||
| .filter(|&n| { | ||
| HypersyncNetwork::iter() | ||
| //able to cast as u64 because networks enum | ||
| //uses repr(u64) attribute | ||
| .find(|&sn| n as u64 == sn as u64) | ||
| .is_some() | ||
| }) | ||
| .collect(); |
There was a problem hiding this comment.
I removed this filtering of only offering hypersync networks for contract import. It should now be obvious if they are hyper sync networks or not from the icon.
Adds chain tiers and icon to network selection

Uses API to manage only public chains/tiers and check tests