From b6d65980e7109480f03dd582b0a1b73000f43fd8 Mon Sep 17 00:00:00 2001 From: overcat <4catcode@gmail.com> Date: Sat, 3 Jun 2023 22:15:41 +0800 Subject: [PATCH] Add transaction hash to tx info screens --- src/lumensigner/gui/screens/sign_tx_screens.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lumensigner/gui/screens/sign_tx_screens.py b/src/lumensigner/gui/screens/sign_tx_screens.py index 76a5c8c..5bca83d 100644 --- a/src/lumensigner/gui/screens/sign_tx_screens.py +++ b/src/lumensigner/gui/screens/sign_tx_screens.py @@ -115,12 +115,11 @@ def __post_init__(self): ) -def build_tx_info_screens( - tx: Transaction, network_passphrase: str -) -> List[GenericTxDetailsScreen]: +def build_tx_info_screens(te: TransactionEnvelope) -> List[GenericTxDetailsScreen]: + tx = te.transaction items = [] # Network - network_title, network_content = format_network(network_passphrase) + network_title, network_content = format_network(te.network_passphrase) items.append(Item(label=network_title, content=network_content)) # Max Fee @@ -225,6 +224,8 @@ def build_tx_info_screens( Item(label="Transaction Source", content=tx.source.universal_account_id) ) + items.append(Item(label="Transaction Hash", content=te.hash_hex())) + item_size = 4 item_count = len(items) screen_count = math.ceil(item_count / item_size) @@ -1117,7 +1118,7 @@ def build_transaction_screens( raise ValueError("Transaction must have at least one operation") screens = [] - screens.extend(build_tx_info_screens(tx, te.network_passphrase)) + screens.extend(build_tx_info_screens(te)) for i, op in enumerate(tx.operations): if isinstance(op, CreateAccount):