-
Notifications
You must be signed in to change notification settings - Fork 84
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
sourceList should preserve its original ordering #112
Comments
This was referenced Oct 28, 2020
Closed
For some reason, #120 failed to fix this. This was my workaround: diff --git a/crytic_compile/platform/solc.py b/crytic_compile/platform/solc.py
index 395f48e..1793658 100644
--- a/crytic_compile/platform/solc.py
+++ b/crytic_compile/platform/solc.py
@@ -61,6 +61,7 @@ def export_to_solc(crytic_compile: "CryticCompile", **kwargs: str) -> Union[str,
# Create additional informational objects.
sources = {filename: {"AST": ast} for (filename, ast) in crytic_compile.asts.items()}
source_list = [x.absolute for x in crytic_compile.filenames]
+ source_list.sort()
# Create our root object to contain the contracts and other information.
output = {"sources": sources, "sourceList": source_list, "contracts": contracts} but I don't know if the PR is wrong or just my original idea about this issue is wrong. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
sourceList
field does not always preserve its original order:crytic-compile/crytic_compile/platform/solc.py
Lines 63 to 66 in 7f6a1c6
This is caused because
crytic_compile.filenames
is a Set and converting it to a list won't always preserve its original ordering. Unfortunately, some external software like hevm relies on this to match code in different sources.The text was updated successfully, but these errors were encountered: