Skip to content

Commit

Permalink
list: Add address shortening
Browse files Browse the repository at this point in the history
  • Loading branch information
cblp committed Oct 3, 2024
1 parent fb9c9fb commit b950333
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions list.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def check_insert(adict: dict[str, str], k: str, value: str) -> None:
adict[k] = value


def shorten_address(address: str) -> str:
return "*" + address[-4:]


def main() -> None:
args = parse_args()

Expand Down Expand Up @@ -91,8 +95,8 @@ def main() -> None:
print("Other holders:")
for code, issuer in trust.items():
asset = f"{code}-{issuer}" if args.issuer else code
print(f" {asset} is held by ", end="")
print(get_holder(code, issuer))
print(f" {asset:11} is held by ", end="")
print(shorten_address(get_holder(code, issuer)))


if __name__ == "__main__":
Expand Down

0 comments on commit b950333

Please sign in to comment.