mirror of
https://github.com/markqvist/LXMF.git
synced 2025-07-05 11:24:41 -04:00
Add test entrypoint to LXStamper
This commit is contained in:
parent
058186dfdc
commit
ea49d22bce
1 changed files with 18 additions and 1 deletions
|
@ -261,3 +261,20 @@ def job_android(stamp_cost, workblock):
|
||||||
RNS.trace_exception(e)
|
RNS.trace_exception(e)
|
||||||
|
|
||||||
return stamp, total_rounds
|
return stamp, total_rounds
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import sys
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
RNS.log("No cost argument provided", RNS.LOG_ERROR)
|
||||||
|
exit(1)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
cost = int(sys.argv[1])
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log(f"Invalid cost argument provided: {e}", RNS.LOG_ERROR)
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
RNS.loglevel = RNS.LOG_DEBUG
|
||||||
|
RNS.log("Testing LXMF stamp generation", RNS.LOG_DEBUG)
|
||||||
|
message_id = os.urandom(32)
|
||||||
|
generate_stamp(message_id, cost)
|
Loading…
Add table
Add a link
Reference in a new issue