feat[tool]: add venom artifacts into solc_json output#4637
feat[tool]: add venom artifacts into solc_json output#4637charles-cooper merged 15 commits intovyperlang:masterfrom
solc_json output#4637Conversation
…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.
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
|
|
||
| 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.
maybe extract this list to a top level variable
vyper/cli/vyper_json.py
Outdated
| 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.
ditto -- venom_keys could be top level variable
solc_json output
|
this lgtm, @cyberthirst please take a look |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4637 +/- ##
==========================================
+ Coverage 92.79% 92.92% +0.13%
==========================================
Files 131 131
Lines 18973 18991 +18
Branches 3288 3295 +7
==========================================
+ Hits 17606 17648 +42
+ Misses 934 905 -29
- Partials 433 438 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| "search_paths": [], | ||
| "outputSelection": {"*": ["ast"]}, | ||
| "search_paths": ["."], | ||
| "outputSelection": {"*": ["ast", "bb", "bb_runtime", "cfg", "cfg_runtime"]}, |
There was a problem hiding this comment.
ast is not tested for
vyper/cli/vyper_json.py
Outdated
| input_dict["settings"].get(alias, False) for alias in ("venom", "experimentalCodegen") | ||
| ) | ||
| if not should_output_venom: | ||
| outputs = [k for k in outputs if k not in VENOM_KEYS] |
There was a problem hiding this comment.
so some venom key was requested, but we silently ignore the request and don't output it. i'd expected that incompatible options would rather raise
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
venomflagHow to verify it
Added tests inside
test_compile_json.pyCommit message
Description for the changelog
['bb', 'bb_runtime', 'cfg', 'cfg_runtime']Cute Animal Picture