From 6e21dac387529cb45cd071e30107632410d92440 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 12 May 2025 10:51:19 +0200 Subject: [PATCH] fix: tui contacts edit label and delete button the edit label button did crash the application because get_string returned bytes instead of a string. The delete button was not implemented but shown in the tui. --- electrum/gui/text.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/electrum/gui/text.py b/electrum/gui/text.py index da398fdff..4fa602ea7 100644 --- a/electrum/gui/text.py +++ b/electrum/gui/text.py @@ -136,11 +136,11 @@ class ElectrumGui(BaseElectrumGui, EventListener): def verify_seed(self): pass - def get_string(self, y, x): + def get_string(self, y, x) -> str: self.set_cursor(1) curses.echo() self.stdscr.addstr(y, x, " "*20, curses.A_REVERSE) - s = self.stdscr.getstr(y,x) + s = self.stdscr.getstr(y,x).decode() curses.noecho() self.set_cursor(0) return s @@ -514,7 +514,10 @@ class ElectrumGui(BaseElectrumGui, EventListener): elif out == "Edit label": s = self.get_string(6 + self.pos, 18) if s: - self.wallet.set_label(key, s) + self.contacts[key] = ('address', s) + elif out == "Delete": + self.contacts.pop(key) + self.pos = 0 def run_addresses_tab(self, c): pass