Skip to content

Commit

Permalink
Allow PSBTOverviewScreen to truncate "self-transfer"
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmukai committed May 26, 2022
1 parent 8df1271 commit ad9375c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/seedsigner/gui/screens/psbt_screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __post_init__(self):
# max_destination_col_width += curve_width

# Now let's maximize the actual destination col by adjusting our addr truncation
def calculate_destination_col_width(truncate_at: int):
def calculate_destination_col_width(truncate_at: int = 0):
def truncate_destination_addr(addr):
return f"{addr[:truncate_at]}..."

Expand All @@ -129,7 +129,7 @@ def truncate_destination_addr(addr):
destination_column.append(truncate_destination_addr(addr))

for i in range(0, self.num_self_transfer_outputs):
destination_column.append(f"self-transfer")
destination_column.append(truncate_destination_addr("self-transfer"))
else:
# destination_column.append(f"{len(self.destination_addresses)} recipients")
destination_column.append(f"recipient 1")
Expand All @@ -151,7 +151,7 @@ def truncate_destination_addr(addr):

if len(self.destination_addresses) + self.num_self_transfer_outputs > 3:
# We're not going to display any destination addrs so truncation doesn't matter
(destination_text_width, destination_column) = calculate_destination_col_width(truncate_at=0)
(destination_text_width, destination_column) = calculate_destination_col_width()
else:
# Steadliy widen out the destination column until we run out of space
for i in range(6, 13):
Expand Down

0 comments on commit ad9375c

Please sign in to comment.