-
Notifications
You must be signed in to change notification settings - Fork 91
add etherscan function to ignore/remove unused contracts #247
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
base: dev
Are you sure you want to change the base?
Conversation
…of a deployed contract
| root_file_path = None | ||
| base_path = "" | ||
| for file_path, file_ast in compilation_unit.asts.items(): | ||
| if root_file_path is not None: # already found target contract |
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.
changing this to != will make the mypy error go away. But then pylint will error saying it needs to be is not..
| root_file_path = None | ||
| base_path = "" | ||
| for file_path, file_ast in compilation_unit.asts.items(): | ||
| if root_file_path is not None: # already found target contract | ||
| break | ||
| for node in file_ast["nodes"]: | ||
| if node["nodeType"] == "ContractDefinition" and node["name"] == root_contract_name: | ||
| root_file_path = file_path | ||
| base_path = file_path.replace(file_ast["absolutePath"], "") | ||
| break | ||
|
|
||
| if root_file_path is None: | ||
| # we could not find a contract with that name in any of the files | ||
| return |
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.
| root_file_path = None | |
| base_path = "" | |
| for file_path, file_ast in compilation_unit.asts.items(): | |
| if root_file_path is not None: # already found target contract | |
| break | |
| for node in file_ast["nodes"]: | |
| if node["nodeType"] == "ContractDefinition" and node["name"] == root_contract_name: | |
| root_file_path = file_path | |
| base_path = file_path.replace(file_ast["absolutePath"], "") | |
| break | |
| if root_file_path is None: | |
| # we could not find a contract with that name in any of the files | |
| return | |
| root_file_path = None | |
| found = False | |
| base_path = "" | |
| for file_path, file_ast in compilation_unit.asts.items(): | |
| if found: # already found target contract | |
| break | |
| for node in file_ast["nodes"]: | |
| if node["nodeType"] == "ContractDefinition" and node["name"] == root_contract_name: | |
| root_file_path = file_path | |
| found = True | |
| base_path = file_path.replace(file_ast["absolutePath"], "") | |
| break | |
| if not found: | |
| # we could not find a contract with that name in any of the files | |
| return |
|
Alexander Remie seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
fixes #246