Skip to content

Commit

Permalink
improve panic message
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed May 24, 2024
1 parent 0156f99 commit 84aadb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vyper/semantics/analysis/data_positions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import defaultdict
from typing import Generic, Optional, TypeVar
import json

from vyper import ast as vy_ast
from vyper.evm.opcodes import version_check
Expand Down Expand Up @@ -28,7 +29,11 @@ def set_data_positions(

# sanity check that generated layout file is the same as the input.
roundtrip = generate_layout_export(vyper_module).get(_LAYOUT_KEYS[DataLocation.STORAGE], {})
assert roundtrip == storage_layout_overrides, roundtrip
if roundtrip != storage_layout_overrides:
msg = "Computed storage layout does not match override file!\n"
msg += f"expected: {json.dumps(storage_layout_overrides)}\n\n"
msg += f"got:\n{json.dumps(roundtrip)}"
raise CompilerPanic(msg)
else:
_allocate_layout_r(vyper_module)

Expand Down

0 comments on commit 84aadb7

Please sign in to comment.