commit 24247c8d31ef8e85ad3971d455c5fb27640bc395
parent 90c34c3c29df9f76ef5adee0411c0baac56f41f1
Author: lash <dev@holbrook.no>
Date: Thu, 15 Jan 2026 15:06:45 +0000
WIP make cli tool output conform to schema
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dummy/usawa/runnable/add.py b/dummy/usawa/runnable/add.py
@@ -137,6 +137,7 @@ db = ValkeyStore('')
store = LedgerStore(db, ledger)
pk = store.get_key()
wallet = DemoWallet(privatekey=pk)
+ledger.set_wallet(wallet)
dt = datetime.datetime.now()
@@ -178,5 +179,6 @@ entry.sign(wallet)
store.add_entry(entry)
ledger.add_entry(entry, modify_tree=True)
ledger.truncate()
+ledger.sign()
ctx.f.write(ledger.to_string())
ctx.close()
diff --git a/dummy/usawa/runnable/create.py b/dummy/usawa/runnable/create.py
@@ -4,6 +4,7 @@ import logging
import urllib.parse
import argparse
import datetime
+import uuid
from usawa import Ledger, DemoWallet, UnitIndex, ACL
from usawa.store import LedgerStore
@@ -46,6 +47,8 @@ class Context:
ctx.unit_precision = args.unit_precision
ctx.uidx = UnitIndex(ctx.unit, precision=ctx.unit_precision)
ctx.topic = args.topic
+ if ctx.topic == None:
+ ctx.topic = str(uuid.uuid4())
ctx.uri = args.src_uri
if args.output != None:
ctx.output = os.path.realpath(args.output)