Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix implements tests #48

Open
wants to merge 1 commit into
base: feat/reject-implements-empty
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/functional/codegen/modules/test_interface_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def test_import_interface_flags(make_input_bundle, get_contract):
MOO
POO

interface IFoo:
def foo() -> Foo: nonpayable
@nonpayable
def foo() -> Foo:
...
"""

contract = """
Expand Down
3 changes: 3 additions & 0 deletions tests/functional/codegen/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def test_log_interface_event(make_input_bundle, assert_compile_failed):
interface_code = """
event Foo:
a: uint256

def bar() -> uint256:
...
"""

input_bundle = make_input_bundle({"a.vyi": interface_code})
Expand Down
12 changes: 10 additions & 2 deletions tests/unit/compiler/test_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,19 +458,27 @@ def bar():
def test_event_no_export_implements(make_input_bundle):
# test events are not exported even if they are in implemented interface
ifoo = """
@external
def foo():
...

event MyEvent:
pass
"""
main = """
import ifoo

implements: ifoo

@external
def foo():
pass
"""
input_bundle = make_input_bundle({"ifoo.vyi": ifoo})
out = compile_code(main, input_bundle=input_bundle, output_formats=["abi"])
expected = {"abi": []}

assert out == expected
assert len(out["abi"]) == 1
assert out["abi"][0]["name"] == "foo"


def test_event_export_interface(make_input_bundle):
Expand Down
Loading