From e34e61a5c6bec62fc3afdd2f75e89c6d96e21a0e Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 28 Apr 2021 13:03:35 +0200 Subject: [PATCH 1/2] Fix zip loaded with multiple compilation unit --- crytic_compile/platform/standard.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crytic_compile/platform/standard.py b/crytic_compile/platform/standard.py index aefba9c6..25d0618a 100644 --- a/crytic_compile/platform/standard.py +++ b/crytic_compile/platform/standard.py @@ -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"], @@ -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(): From eb9c3f85f77a0e165d3ca876402c42321e35731c Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 28 Apr 2021 13:10:28 +0200 Subject: [PATCH 2/2] Disable mypy in gh super linter --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e5a47048..b94501d8 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -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"