Skip to content

Commit

Permalink
Add transaction hash to tx info screens
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Jun 3, 2023
1 parent b83633d commit b6d6598
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/lumensigner/gui/screens/sign_tx_screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit b6d6598

Please sign in to comment.