Skip to content

Improve error messages when not correctly implementing #4771

@Sporarum

Description

@Sporarum

Currently, the following happens:

interface Foo:
  def foo() -> uint256: view

implements: Foo

@external
def foo() -> uint256:
    return 0

vyper.exceptions.InterfaceViolation: Contract does not implement all interface functions: foo()

Even though a function foo() is implemented (but it does not have the correct mutability)

Instead the error should be something like this:

vyper.exceptions.InterfaceViolation: The following methods are not implemented by the contract:
  Foo.foo:
      Found method `foo`, but mutability is non-payable instead of view
      hint: add view modifier

With similar errors if the return type or signature is incorrect, or if the method is not implemented at all
It should keep showing all unimplemented methods at once

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions