Skip to content

Commit

Permalink
fix: rpc config
Browse files Browse the repository at this point in the history
  • Loading branch information
ameeshaagrawal committed Dec 13, 2023
1 parent 6f9bbe3 commit ba54f5e
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions scripts/rpcConfig/rpcConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,31 @@ const getBlockNumber = (
deploymentMode: DeploymentMode,
chainSlug: ChainSlug
) => {
const addresses = getAddresses(chainSlug, deploymentMode);
return addresses.startBlock ?? 1;
try {
const addresses = getAddresses(chainSlug, deploymentMode);
return addresses.startBlock ?? 1;
} catch (error) {
return 1;
}
};

const getSiblings = (
deploymentMode: DeploymentMode,
chainSlug: ChainSlug
): ChainSlug[] => {
const integrations: Integrations = getAddresses(
chainSlug,
deploymentMode
).integrations;
if (!integrations) return [] as ChainSlug[];
try {
const integrations: Integrations = getAddresses(
chainSlug,
deploymentMode
).integrations;
if (!integrations) return [] as ChainSlug[];

return Object.keys(integrations).map(
(chainSlug) => parseInt(chainSlug) as ChainSlug
);
return Object.keys(integrations).map(
(chainSlug) => parseInt(chainSlug) as ChainSlug
);
} catch (error) {
return [] as ChainSlug[];
}
};

const rpcs = {
Expand Down Expand Up @@ -300,9 +308,7 @@ const prodConfig = {
ChainSlug.POLYGON_MUMBAI,
// ChainSlug.BSC_TESTNET,
ChainSlug.LYRA_TESTNET,
ChainSlug.XAI_TESTNET,
ChainSlug.SX_NETWORK_TESTNET,
ChainSlug.CDK_TESTNET,
ChainSlug.ARBITRUM_SEPOLIA,
ChainSlug.OPTIMISM_SEPOLIA,
ChainSlug.MODE_TESTNET,
Expand All @@ -327,9 +333,7 @@ const prodConfig = {
ChainSlug.POLYGON_MUMBAI,
// ChainSlug.BSC_TESTNET,
ChainSlug.LYRA_TESTNET,
ChainSlug.XAI_TESTNET,
ChainSlug.SX_NETWORK_TESTNET,
ChainSlug.CDK_TESTNET,
ChainSlug.ARBITRUM_SEPOLIA,
ChainSlug.OPTIMISM_SEPOLIA,
ChainSlug.MODE_TESTNET,
Expand Down

0 comments on commit ba54f5e

Please sign in to comment.