Fix config to handle when infura key isn't provided (#1380)

pull/1381/head
Nikhil Parasaram 5 years ago committed by GitHub
parent 2ba2d3e5bd
commit bd00d944ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      mythril/mythril/mythril_config.py

@ -192,11 +192,14 @@ class MythrilConfig:
if m and m.group(1) in ["mainnet", "rinkeby", "kovan", "ropsten"]: if m and m.group(1) in ["mainnet", "rinkeby", "kovan", "ropsten"]:
if self.infura_id in (None, ""): if self.infura_id in (None, ""):
raise CriticalError( log.info(
"Infura key not provided. Use --infura-id <INFURA_ID> " "Infura key not provided, so onchain access is disabled. "
"Use --infura-id <INFURA_ID> "
"or set it in the environment variable INFURA_ID " "or set it in the environment variable INFURA_ID "
"or in the ~/.mythril/config.ini file'" "or in the ~/.mythril/config.ini file"
) )
self.eth = None
return
rpcconfig = ( rpcconfig = (
"{}.infura.io/v3/{}".format(m.group(1), self.infura_id), "{}.infura.io/v3/{}".format(m.group(1), self.infura_id),

Loading…
Cancel
Save