Skip to content

Commit

Permalink
Fix zip load with multiple compilation unit (#176)
Browse files Browse the repository at this point in the history
* Fix zip loaded with multiple compilation unit
* Disable mypy in gh super linter
  • Loading branch information
montyly authored Apr 28, 2021
1 parent b547d03 commit b00470a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
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

0 comments on commit b00470a

Please sign in to comment.