diff --git a/.eslintrc b/.eslintrc index 538380cd5..e0664d271 100644 --- a/.eslintrc +++ b/.eslintrc @@ -28,7 +28,9 @@ "rules": { "react/prop-types": "off", "react/no-unused-prop-types": "off", - "@typescript-eslint/explicit-function-return-type": "off" + "@typescript-eslint/explicit-function-return-type": "off", + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": "error" } } ] diff --git a/src/utils/wallet.ts b/src/utils/wallet.ts index c39859427..0bacf3515 100644 --- a/src/utils/wallet.ts +++ b/src/utils/wallet.ts @@ -39,6 +39,19 @@ export const web3ModalOpts = { theme: web3ModalTheme } +export function getChainId(network: string): number { + switch (network) { + case 'mainnet': + return 1 + case 'rinkeby': + return 4 + case 'kovan': + return 42 + default: + return 0 + } +} + export function isCorrectNetwork(chainId: number): boolean { const configuredNetwork = getChainId(network) return configuredNetwork === chainId @@ -62,16 +75,3 @@ export function getNetworkName(chainId: number): string { return 'Unknown' } } - -export function getChainId(network: string): number { - switch (network) { - case 'mainnet': - return 1 - case 'rinkeby': - return 4 - case 'kovan': - return 42 - default: - return 0 - } -}