Skip to content

Commit

Permalink
test compilation round trip
Browse files Browse the repository at this point in the history
  • Loading branch information
sandbubbles committed Dec 15, 2024
1 parent e46ccb7 commit bce2a08
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/functional/codegen/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,8 @@ def foo(s: MyStruct) -> MyStruct:
assert "BOO" in out
assert "MOO" in out

compile_code(out, contract_path="code.vyi", output_formats=["interface"])


vyi_filenames = [
"test__test.vyi",
Expand Down Expand Up @@ -940,3 +942,19 @@ def foo() -> Foo:
"external_interface"
]
assert "-> Foo:" in out


def test_external_interface_compiles_again():
code = """
@external
def foo() -> uint256:
...
@external
def bar(a:int32) -> uint256:
...
"""

out = compile_code(code, contract_path="test.vyi", output_formats=["external_interface"])[
"external_interface"
]
compile_code(out, contract_path="test.vyi", output_formats=["external_interface"])

0 comments on commit bce2a08

Please sign in to comment.