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 zip load with multiple compilation unit #176

Merged
merged 2 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ jobs:
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_EDITORCONFIG: false
VALIDATE_JSCPD: false
VALIDATE_PYTHON_MYPY: false
SHELLCHECK_OPTS: "-e SC1090 -e SC2181 -e SC2103"
12 changes: 6 additions & 6 deletions crytic_compile/platform/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ def load_from_compile(crytic_compile: "CryticCompile", loaded_json: Dict) -> Tup
_load_from_compile_legacy(crytic_compile, loaded_json)

else:
for key, compilation_unit in loaded_json["compilation_units"]:
for key, compilation_unit_json in loaded_json["compilation_units"].items():
compilation_unit = CompilationUnit(crytic_compile, key)
compilation_unit.compiler_version = CompilerVersion(
compiler=loaded_json["compiler"]["compiler"],
version=loaded_json["compiler"]["version"],
optimized=loaded_json["compiler"]["optimized"],
compiler=compilation_unit_json["compiler"]["compiler"],
version=compilation_unit_json["compiler"]["version"],
optimized=compilation_unit_json["compiler"]["optimized"],
)
for contract_name, contract in loaded_json["contracts"].items():
for contract_name, contract in compilation_unit_json["contracts"].items():
compilation_unit.contracts_names.add(contract_name)
filename = Filename(
absolute=contract["filenames"]["absolute"],
Expand Down Expand Up @@ -272,7 +272,7 @@ def load_from_compile(crytic_compile: "CryticCompile", loaded_json: Dict) -> Tup
crytic_compile.dependencies.add(filename.relative)
crytic_compile.dependencies.add(filename.short)
crytic_compile.dependencies.add(filename.used)
compilation_unit.asts = loaded_json["asts"]
compilation_unit.asts = compilation_unit_json["asts"]

# Set our filenames
for compilation_unit in crytic_compile.compilation_units.values():
Expand Down