From 052ff3878015db4ba2e1ae81abc046b657a25126 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 15 Nov 2026 10:56:44 +0000 Subject: [PATCH] amt: pass coin unit to `hl3()` --- mmgen/amt.py | 4 ++-- mmgen/autosign/signable.py | 2 +- mmgen/tw/prune.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mmgen/amt.py b/mmgen/amt.py index 62ab1859..f5650e63 100644 --- a/mmgen/amt.py +++ b/mmgen/amt.py @@ -109,12 +109,12 @@ class CoinAmt(Decimal, Hilite, InitErrors): # abstract class return self.colorize2(str(self), color=color, color_override=color_override) # fancy highlighting with coin unit, enclosure, formatting - def hl3(self, *, color=True, unit=False, fs='{}', encl='', color_override=''): + def hl3(self, *, color=True, unit=None, fs='{}', encl='', color_override=''): res = fs.format(self) return self.colorize2( encl[:-1] + (res.rstrip('0').rstrip('.') if '.' in res else res) - + (' ' + self.coin if unit else '') + + (' ' + unit if unit else '') + encl[1:], color = color, color_override = color_override) diff --git a/mmgen/autosign/signable.py b/mmgen/autosign/signable.py index 15984600..712f457f 100644 --- a/mmgen/autosign/signable.py +++ b/mmgen/autosign/signable.py @@ -130,7 +130,7 @@ class Signable: if nm is non_mmgen[0] else ''.ljust(t_wid), a = nm.addr.fmt(nm.addr.view_pref, a_wid, color=True) if nm.addr else '-'.ljust(a_wid), - A = nm.amt.hl() + ' ' + yellow(tx.coin)) + A = nm.amt.hl3(unit=tx.proto.dcoin)) msg('\n' + '\n'.join(gen())) else: diff --git a/mmgen/tw/prune.py b/mmgen/tw/prune.py index fb656084..2e251486 100644 --- a/mmgen/tw/prune.py +++ b/mmgen/tw/prune.py @@ -88,7 +88,7 @@ class TwAddressesPrune(TwAddresses): red('Address #{a} ({b}) has a balance of {c}!'.format( a = addrnum, b = e.twmmid.addr, - c = e.amt.hl3(color=False, unit=True))), + c = e.amt.hl3(color=False, unit=self.proto.dcoin))), '[p]rune anyway, [P]rune all with balance, [s]kip, [S]kip all with balance: '), 'used': md( yellow('Address #{a} ({b}) is used!'.format(