feat: record ENSv2 mainnet deployment - #5
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for the DOS Mainnet (chainId 7979) to the subgraph deployment. It introduces the mainnet deployment configuration, updates package scripts, and modifies the manifest rendering script to dynamically replace the network name in the template. The review feedback suggests simplifying the script by removing the redundant EXPECTED_CHAIN_IDS set and dynamically generating the error message for unsupported chain IDs using the keys of the NETWORKS map.
| const EXPECTED_CHAIN_IDS = new Set([3939, 7979]); | ||
| const NETWORKS = new Map([ | ||
| [3939, "dos-testnet"], | ||
| [7979, "dos-mainnet"], | ||
| ]); |
There was a problem hiding this comment.
| if (!EXPECTED_CHAIN_IDS.has(deployment?.chainId)) { | ||
| throw new Error("chainId must be one of 3939, 7979"); | ||
| } |
There was a problem hiding this comment.
Instead of checking EXPECTED_CHAIN_IDS, we can check NETWORKS.has(...). Additionally, we can dynamically construct the error message using the keys of NETWORKS to prevent the error message from becoming out of sync when new networks are added.
| if (!EXPECTED_CHAIN_IDS.has(deployment?.chainId)) { | |
| throw new Error("chainId must be one of 3939, 7979"); | |
| } | |
| if (!NETWORKS.has(deployment?.chainId)) { | |
| throw new Error("chainId must be one of " + Array.from(NETWORKS.keys()).join(", ")); | |
| } |
Summary
On-chain evidence
Validation