-
Notifications
You must be signed in to change notification settings - Fork 192
Conversation
- if an alias exists for the address, print the alias
I could not resolve the conflict via Github web. For some reason it won't load completely so I can't update the CHANGELOG. You'll have to do it 🤷♂ |
…into pretty-print-alias-2
@ixje okay, it should be good now |
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.
if you can also resolve the readme on this branch then I can merge. The webbased "resolve conflicts" isn't working for this one either (probably due to same branching point 🤷♂ )
@@ -525,8 +525,17 @@ def pretty_print(self, verbose=False): | |||
'tokens': self._get_token_balances(addr_str) | |||
}}) | |||
|
|||
aliases = dict() | |||
alia = NamedAddress.select() | |||
if len(alia): |
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.
we can skip this and do for n in NamedAddress.select()
as the return value is always a ModelSelect
type which supports iterating
# pretty print | ||
for address, data in addresses.items(): | ||
for title, addr in aliases.items(): |
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.
Just as a general comment;
I think we could have used NamedAddress.get()
to query if an alias exists for the given address/scripthash instead of iterating over all available data. Now it doesn't really matter as we won't have a huge list of aliases. Just something to try and keep in mind when you encounter some performance critical part with larger data sets.
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.
Thank you for the feedback!
I changed the log entry to
because your entry described the internal change that requires "inside" knowledge. This describes the impact for the user |
Thank you! I will try to keep that in mind for future Changelog entries. |
50 points |
What current issue(s) does this address, or what feature is it adding?
How did you solve this problem?
NOTE: Right now there is no ability within neo-python to update/delete the alias once it is set. I think this should be a future feature update.
How did you make sure your solution works?
manual testing initially and
make test
after tests were updatedAre there any special changes in the code that we should be aware of?
no
Please check the following, if applicable:
make lint
?make test
?CHANGELOG.rst
? (if not, please do)