Implemented outbound stamp cost handling and stamp cost display in object details

This commit is contained in:
Mark Qvist 2024-09-07 11:30:19 +02:00
parent ff58028ca7
commit 5d586d26fc
3 changed files with 36 additions and 1 deletions

View file

@ -158,6 +158,13 @@ class Messages():
if prg != None:
prgstr = ", "+str(round(prg*100, 1))+"% done"
if prg <= 0.00:
stamp_cost = self.app.sideband.get_lxm_stamp_cost(msg["hash"])
if stamp_cost:
sphrase = f"Generating stamp (cost {stamp_cost})"
prgstr = ""
else:
sphrase = "Waiting for path"
elif prg <= 0.01:
sphrase = "Waiting for path"
elif prg <= 0.03:
sphrase = "Establishing link"

View file

@ -805,6 +805,14 @@ class RVDetails(MDRecycleView):
except Exception as e:
RNS.trace_exception(e)
try:
stamp_cost = self.delegate.app.sideband.message_router.get_outbound_stamp_cost(self.delegate.object_hash)
if stamp_cost:
self.entries.append({"icon": "postage-stamp", "text": f"Required stamp cost [b]{stamp_cost}[/b]", "on_release": pass_job})
except Exception as e:
RNS.trace_exception(e)
if len(self.entries) == 0:
self.entries.append({"icon": "timeline-question-outline", "text": f"No telemetry available for this device"})