diff --git a/workbench-script.py b/workbench-script.py index 429cfc7..b16c6ed 100644 --- a/workbench-script.py +++ b/workbench-script.py @@ -13,14 +13,9 @@ import gettext import locale import logging -from pathlib import Path -from string import Template from datetime import datetime -BASE_DIR = Path(__file__).resolve().parent - - SNAPSHOT_BASE = { 'timestamp': str(datetime.now()), 'type': 'Snapshot', @@ -496,9 +491,13 @@ def main(): convert_to_legacy_snapshot(snapshot) snapshot = json.dumps(snapshot) else: - snapshot = convert_to_credential(snapshot) url_wallet = config.get("url_wallet") wb_sign_token = config.get("wb_sign_token") + + if wb_sign_token: + tk = wb_sign_token.encode("utf8") + snapshot["token_hash"] = hashlib.hash256(tk).hexdigest() + if url_wallet and wb_sign_token: snapshot = send_to_sign_credential(snapshot, wb_sign_token, url_wallet)