Skip to content

Commit bda2f34

Browse files
committed
fix(vyper): only raise InvalidCompilation on hard errors
1 parent 7135957 commit bda2f34

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ jobs:
3333
# Explore foundry support in windows
3434
- os: windows-2022
3535
type: foundry
36-
# Deprecation alerts in vyper with newer python, which trip tests
37-
- python: 3.12
38-
type: vyper
3936
# brownie does not install correctly with Python 3.12
4037
- python: 3.12
4138
type: brownie
@@ -59,9 +56,8 @@ jobs:
5956
python-version: ${{ matrix.python }}
6057
- name: Install dependencies
6158
run: |
62-
pip install "solc-select>=v1.0.0b1"
63-
solc-select use 0.5.7 --always-install
6459
pip install .
60+
solc-select use 0.5.7 --always-install
6561
- name: Set up nix
6662
if: matrix.type == 'dapp'
6763
uses: cachix/install-nix-action@v23

crytic_compile/platform/vyper.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,21 @@ def _run_vyper_standard_json(
206206
) # convert bytestrings to unicode strings
207207

208208
vyper_standard_output = json.loads(stdout)
209+
209210
if "errors" in vyper_standard_output:
210-
# TODO format errors
211-
raise InvalidCompilation(vyper_standard_output["errors"])
211+
212+
has_errors = False
213+
for diagnostic in vyper_standard_output["errors"]:
214+
215+
if diagnostic["severity"] == "warning":
216+
continue
217+
218+
msg = diagnostic.get("formattedMessage", diagnostic["message"])
219+
LOGGER.error(msg)
220+
has_errors = True
221+
222+
if has_errors:
223+
raise InvalidCompilation("Vyper compilation errored")
212224

213225
return vyper_standard_output
214226

0 commit comments

Comments
 (0)