From f909d6eb8586f747e088bcfa9681f09bc762c72d Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Fri, 9 Aug 2024 17:36:02 +0800 Subject: [PATCH] fix[tool]: update `InterfaceT.__str__` implementation (#4205) this doesn't affect anything in vyper codebase, but affects the serialization of interface types for tooling (including titanoboa) --- tests/functional/syntax/test_external_calls.py | 2 +- vyper/semantics/types/module.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/functional/syntax/test_external_calls.py b/tests/functional/syntax/test_external_calls.py index 79f3f6db93..a8fb5ae87b 100644 --- a/tests/functional/syntax/test_external_calls.py +++ b/tests/functional/syntax/test_external_calls.py @@ -305,7 +305,7 @@ def bar(): extcall Foo(msg.sender) """, StructureException, - "Function `type(interface Foo)` cannot be called without assigning the result", + "Function `type(Foo)` cannot be called without assigning the result", None, ), ] diff --git a/vyper/semantics/types/module.py b/vyper/semantics/types/module.py index 60eb93bcac..ba72842c65 100644 --- a/vyper/semantics/types/module.py +++ b/vyper/semantics/types/module.py @@ -76,6 +76,9 @@ def getter_signature(self): def abi_type(self) -> ABIType: return ABI_Address() + def __str__(self): + return self._id + def __repr__(self): return f"interface {self._id}"