Skip to content
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

fix: empty contract name in jobs #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mythx_cli/analyze/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,13 @@ def analyze(
# reduce to whitelisted contract names
if include:
LOGGER.debug(f"Filtering {len(jobs)} job(s) for contracts to be included")
found_contracts = {job["contract_name"] for job in jobs}
found_contracts = {job["contract_name"] for job in jobs if "contract_name" in job}
overlap = set(include).difference(found_contracts)
if overlap:
raise click.UsageError(
f"The following contracts could not be found: {', '.join(overlap)}"
)
jobs = [job for job in jobs if job["contract_name"] in include]
jobs = [job for job in jobs if "contract_name" in job if job["contract_name"] in include]

# filter jobs where no bytecode was produced
LOGGER.debug(f"Filtering {len(jobs)} job(s) for empty bytecode")
Expand Down