diff --git a/CHANGELOG.md b/CHANGELOG.md index d19f7b9..8baba7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/vyperlang/vvm/) ### Changed -- Update contact information in `CONTRIBUTING.md` +- Update contact information in `CONTRIBUTING.md` ([#17](https://github.com/vyperlang/vvm/pull/17), [#18](https://github.com/vyperlang/vvm/pull/18)) - Update dependencies. Minimum python version is now 3.8 ([#22](https://github.com/vyperlang/vvm/pull/22)) - Add `output_format` argument to `compile_source` and `compile_files` ([#21](https://github.com/vyperlang/vvm/pull/21)) - New public function `detect_vyper_version_from_source` ([#23](https://github.com/vyperlang/vvm/pull/23)) +- Fix `combine_json` for versions `>0.3.10` ([#29](https://github.com/vyperlang/vvm/pull/29)) ## [0.1.0](https://github.com/vyperlang/vvm/tree/v0.1.0) - 2020-10-07 ### Added diff --git a/tests/test_compile_source.py b/tests/test_compile_source.py index 1669369..61957ea 100644 --- a/tests/test_compile_source.py +++ b/tests/test_compile_source.py @@ -9,6 +9,7 @@ def test_compile_source(foo_source, vyper_version): pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json") output = vvm.compile_source(foo_source) assert "" in output + assert "bytecode" in output[""] def test_compile_files(foo_path, vyper_version): diff --git a/vvm/main.py b/vvm/main.py index 29aed4a..50b404e 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -76,6 +76,10 @@ def compile_source( ) if output_format in ("combined_json", None): + # Vyper 0.4.0 and up puts version at the front of the dict, which breaks + # the `list(compiler_data.values())[0]` on the next line, so remove it. + # Assumes the source file is not named `version` (without extension) + compiler_data.pop("version", None) return {"": list(compiler_data.values())[0]} return compiler_data