-
-
Notifications
You must be signed in to change notification settings - Fork 849
feat[tool]: add venom artifacts into solc_json
output
#4637
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
base: master
Are you sure you want to change the base?
Conversation
…iled result when calling compile_json()
translate_map.remove("bb") | ||
translate_map.remove("bb_runtime") | ||
translate_map.remove("cfg") | ||
translate_map.remove("cfg_runtime") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style, bit more compact:
translate_map.remove("bb") | |
translate_map.remove("bb_runtime") | |
translate_map.remove("cfg") | |
translate_map.remove("cfg_runtime") | |
venom_outputs = ("bb", "bb_runtime", "cfg", "cfg_runtime") | |
for s in venom_outputs: | |
translate_map.remove(s) |
vyper/cli/vyper_json.py
Outdated
@@ -245,6 +249,10 @@ def get_output_formats(input_dict: dict) -> dict[PurePath, list[str]]: | |||
raise JSONError(f"Invalid outputSelection - {e}") | |||
|
|||
outputs = sorted(list(outputs)) | |||
if not input_dict["settings"].get("venom") and not input_dict["settings"].get("experimentalCodegen"): | |||
for key in ["bb", "bb_runtime", "cfg", "cfg_runtime"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe extract this list to a top level variable
vyper/cli/vyper_json.py
Outdated
@@ -401,6 +409,18 @@ def format_to_output_dict(compiler_data: dict) -> dict: | |||
if "source_map_runtime" in data: | |||
evm["sourceMap"] = data["source_map_runtime"] | |||
|
|||
venom_keys = ("bb", "bb_runtime", "cfg", "cfg_runtime",) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto -- venom_keys could be top level variable
solc_json
output
What I did
I added the venom optimizer keys
['bb', 'bb_runtime', 'cfg', 'cfg_runtime']
into the compiled output when callingcompile_json()
How I did it
Adapted the translate map and guarded it with the
venom
flagHow to verify it
Added tests inside
test_compile_json.py
Commit message
feat: add venom optimizer keys ['bb', 'bb_runtime', 'cfg', 'cfg_runtime'] into the compiled output when calling compile_json()
Description for the changelog
['bb', 'bb_runtime', 'cfg', 'cfg_runtime']
Cute Animal Picture