-
Notifications
You must be signed in to change notification settings - Fork 2
chore: Remove createMapWithDefault utility #430
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
Conversation
|
|
||
| export const isTestnet = (chainId: number): boolean => { | ||
| return ( | ||
| chainId === CHAIN_IDs.ARBITRUM_SEPOLIA || | ||
| chainId === CHAIN_IDs.HYPEREVM_TESTNET || | ||
| chainId === CHAIN_IDs.BASE_SEPOLIA || | ||
| chainId === CHAIN_IDs.BLAST_SEPOLIA || | ||
| chainId === CHAIN_IDs.LISK_SEPOLIA || | ||
| chainId === CHAIN_IDs.MODE_SEPOLIA || | ||
| chainId === CHAIN_IDs.OPTIMISM_SEPOLIA || | ||
| chainId === CHAIN_IDs.POLYGON_AMOY || | ||
| chainId === CHAIN_IDs.SEPOLIA || | ||
| chainId === CHAIN_IDs.SOLANA_DEVNET | ||
| ); | ||
| }; |
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.
I think some of these mappings/definitions are already in the constants package and the check can be reduced to smth like
import {
PRODUCTION_NETWORKS,
TEST_NETWORKS,
} from "@across-protocol/constants";
const isMainnet = chainId in PRODUCTION_NETWORKS
const isTestnet = chainId in TEST_NETWORKSThere 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.
Great point, thanks.
I'll make that change
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.
Addressed in ae3d08d
…ross-protocol/constants
Closes https://linear.app/uma/issue/ACB-16/remove-default-mapping