diff --git a/mmgen/proto/xmr/tw/unspent.py b/mmgen/proto/xmr/tw/unspent.py index 21f0423b..afa44d63 100755 --- a/mmgen/proto/xmr/tw/unspent.py +++ b/mmgen/proto/xmr/tw/unspent.py @@ -20,7 +20,6 @@ class MoneroTwUnspentOutputs(MoneroTwView, TwUnspentOutputs): hdr_lbl = 'spendable accounts' desc = 'spendable accounts' - include_empty = False async def __init__(self, cfg, proto, *, minconf=1, addrs=[], tx=None): self.prompt_fs_in = [ @@ -38,6 +37,7 @@ class MoneroTwUnspentOutputs(MoneroTwView, TwUnspentOutputs): 's': 'i_addr_sweep', 'S': 'i_acct_sweep'}) await super().__init__(cfg, proto, minconf=minconf, addrs=addrs, tx=tx) + self.is_sweep = self.include_empty = self.tx and self.tx.is_sweep async def get_idx_from_user(self, method_name): if method_name in ('i_acct_sweep', 'i_addr_sweep'): diff --git a/mmgen/proto/xmr/tw/view.py b/mmgen/proto/xmr/tw/view.py index 6f59433f..f5e98294 100755 --- a/mmgen/proto/xmr/tw/view.py +++ b/mmgen/proto/xmr/tw/view.py @@ -29,6 +29,7 @@ class MoneroTwView: item_desc = 'account' nice_addr_w = {'addr': 20} total = None + is_sweep = False sort_disp = { 'addr': 'Addr', @@ -195,8 +196,14 @@ class MoneroTwView: color = color, color_override = None if d.total == d.unlocked_total else 'orange' )) + rfill - for v in d.data.values(): - yield fmt_method(None, v.data, cw, fs, color, yes, no) + if self.is_sweep: + if d.total: + for v in d.data.values(): + if v.data.amt: + yield fmt_method(None, v.data, cw, fs, color, yes, no) + else: + for v in d.data.values(): + yield fmt_method(None, v.data, cw, fs, color, yes, no) def squeezed_format_line(self, n, d, cw, fs, color, yes, no): return fs.format( diff --git a/test/cmdtest_d/xmr_autosign.py b/test/cmdtest_d/xmr_autosign.py index 3d1fed45..04877830 100755 --- a/test/cmdtest_d/xmr_autosign.py +++ b/test/cmdtest_d/xmr_autosign.py @@ -791,7 +791,7 @@ class CmdTestXMRCompat(CmdTestXMRAutosign): return self._alice_txops('txcreate', menu='S', sweep_menu='23', sweep_type='sweep') def alice_txcreate_sweep2(self): - return self._alice_txops('txcreate', menu='s', sweep_menu='2', sweep_type='sweep_all') + return self._alice_txops('txcreate', menu='s', sweep_menu='3', sweep_type='sweep_all') alice_txcreate3 = alice_txcreate2 = alice_txcreate1