From c6d8839f9ad5eb37a6ce40618a83d25ade646185 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 6 Sep 2026 10:08:41 +0000 Subject: [PATCH] tx.new, tx.new_swap, tx.info: minor cleanups --- mmgen/tx/info.py | 4 +++- mmgen/tx/new.py | 2 +- mmgen/tx/new_swap.py | 10 ++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mmgen/tx/info.py b/mmgen/tx/info.py index e5e8710e..d973d5d2 100755 --- a/mmgen/tx/info.py +++ b/mmgen/tx/info.py @@ -74,7 +74,9 @@ class TxInfo: if tx.is_swap: from ..swap.proto.thorchain import Memo, name - data = tx.swap_memo.encode() if tx.proto.is_vm else tx.data_output.data + data = ( + tx.swap_memo.encode() if tx.proto.is_vm else + tx.data_output.data) if Memo.is_partial_memo(data): recv_mmid = getattr(tx, 'swap_recv_addr_mmid', None) p = Memo.parse(data.decode('ascii')) diff --git a/mmgen/tx/new.py b/mmgen/tx/new.py index 952c56e2..a290e754 100755 --- a/mmgen/tx/new.py +++ b/mmgen/tx/new.py @@ -185,7 +185,7 @@ class New(Base): coin_addr, mmid, is_vault = (None, None, False) - if arg == 'vault' and self.is_swap: + if arg == 'vault' and self.is_swap: # ‘is_swap’ test necessary because could be bump tx is_vault = True elif mmid := get_obj(MMGenID, proto=proto, id_str=arg, silent=True): coin_addr = mmaddr2coinaddr(self.cfg, arg, ad_w, ad_f, proto) diff --git a/mmgen/tx/new_swap.py b/mmgen/tx/new_swap.py index 09b6a300..86187965 100755 --- a/mmgen/tx/new_swap.py +++ b/mmgen/tx/new_swap.py @@ -169,10 +169,12 @@ class NewSwap(New): # this goes into the transaction file: self.swap_recv_addr_mmid = recv_output.mmid - return ( - [f'vault,{args.send_amt}', f'data:{memo}'] if args.send_amt and self.proto.is_vm else - [f'vault,{args.send_amt}', chg_output.mmid, f'data:{memo}'] if args.send_amt else - ['vault', f'data:{memo}']) + ret = ( + [f'vault,{args.send_amt}'] if args.send_amt and self.proto.is_vm else + [f'vault,{args.send_amt}', chg_output.mmid] if args.send_amt else + ['vault']) + + return ret + [f'data:{memo}'] def update_vault_addr(self, c, *, addr='inbound_address'): vault_idx = self.vault_idx