1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

lint fixes

This commit is contained in:
Matthias Kretschmann 2020-09-08 13:55:04 +02:00
parent 6865fae4a8
commit b09e3acb12
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 16 additions and 14 deletions

View File

@ -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"
}
}
]

View File

@ -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
}
}