From 2bdbd846b09c94f05739e1274e00825912404fe3 Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Wed, 27 Sep 2023 21:06:03 +0800 Subject: [PATCH] chore: add metadata to vyper-json (#3622) --- tests/cli/vyper_json/test_output_selection.py | 6 ++++++ vyper/cli/vyper_json.py | 2 +- vyper/compiler/output.py | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/cli/vyper_json/test_output_selection.py b/tests/cli/vyper_json/test_output_selection.py index c72f06f5a7..3b12e2b54a 100644 --- a/tests/cli/vyper_json/test_output_selection.py +++ b/tests/cli/vyper_json/test_output_selection.py @@ -52,3 +52,9 @@ def test_solc_style(): input_json = {"settings": {"outputSelection": {"foo.vy": {"": ["abi"], "foo.vy": ["ir"]}}}} sources = {"foo.vy": ""} assert get_input_dict_output_formats(input_json, sources) == {"foo.vy": ["abi", "ir_dict"]} + + +def test_metadata(): + input_json = {"settings": {"outputSelection": {"*": ["metadata"]}}} + sources = {"foo.vy": ""} + assert get_input_dict_output_formats(input_json, sources) == {"foo.vy": ["metadata"]} diff --git a/vyper/cli/vyper_json.py b/vyper/cli/vyper_json.py index 4a1c91550e..f6d82c3fe0 100755 --- a/vyper/cli/vyper_json.py +++ b/vyper/cli/vyper_json.py @@ -29,7 +29,7 @@ "interface": "interface", "ir": "ir_dict", "ir_runtime": "ir_runtime_dict", - # "metadata": "metadata", # don't include in "*" output for now + "metadata": "metadata", "layout": "layout", "userdoc": "userdoc", } diff --git a/vyper/compiler/output.py b/vyper/compiler/output.py index 334c5ba613..9ef492c3e2 100644 --- a/vyper/compiler/output.py +++ b/vyper/compiler/output.py @@ -104,7 +104,6 @@ def build_ir_runtime_dict_output(compiler_data: CompilerData) -> dict: def build_metadata_output(compiler_data: CompilerData) -> dict: - warnings.warn("metadata output format is unstable!") sigs = compiler_data.function_signatures def _var_rec_dict(variable_record):