-
-
Notifications
You must be signed in to change notification settings - Fork 802
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[ux]: shorten interface name in error messages #4359
base: master
Are you sure you want to change the base?
fix[ux]: shorten interface name in error messages #4359
Conversation
vyper/semantics/types/module.py
Outdated
|
||
def __repr__(self): | ||
return f"interface {self._id}" | ||
return f"interface {Path(self._id).stem}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we want to change the str implementation, but not repr -- repr should attempt to be injective back to interfaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i changed _pp_signature to use str
, i think that should be okay cause its only used for error messages
@@ -79,7 +80,7 @@ def abi_type(self) -> ABIType: | |||
return ABI_Address() | |||
|
|||
def __str__(self): | |||
return self._id | |||
return Path(self._id).stem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the type is aliased? e.g.
from ethereum.ercs import IERC20 as BROWNBEAR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, that would show the ierc20
What I did
Change the string representation of interfaces to a name instead of a path. Fix #4237 and #4299.
How I did it
Use only a part of
_id
as the interface's string representation.How to verify it
Test that the interface either shows as
name
orinterface name
.Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture