From 71dddfb17ee9d302760c22bd0f42f2d8fd18a787 Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Tue, 2 Jun 2020 08:39:09 +0200 Subject: [PATCH] [mod] #237: Move back to ':' pubkey and checksum delimiter Update parsing, help. Change word --- silkaj/crypto_tools.py | 6 +++--- silkaj/tx.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/silkaj/crypto_tools.py b/silkaj/crypto_tools.py index ae28606e..637d2c36 100644 --- a/silkaj/crypto_tools.py +++ b/silkaj/crypto_tools.py @@ -22,7 +22,7 @@ from silkaj.constants import PUBKEY_PATTERN PUBKEY_DELIMITED_PATTERN = "^{0}$".format(PUBKEY_PATTERN) CHECKSUM_PATTERN = "[1-9A-HJ-NP-Za-km-z]{3}" -PUBKEY_CHECKSUM_PATTERN = "^{0}!{1}$".format(PUBKEY_PATTERN, CHECKSUM_PATTERN) +PUBKEY_CHECKSUM_PATTERN = "^{0}:{1}$".format(PUBKEY_PATTERN, CHECKSUM_PATTERN) def check_public_key(pubkey, display_error): @@ -34,7 +34,7 @@ def check_public_key(pubkey, display_error): if re.search(re.compile(PUBKEY_DELIMITED_PATTERN), pubkey): return pubkey elif re.search(re.compile(PUBKEY_CHECKSUM_PATTERN), pubkey): - pubkey, checksum = pubkey.split("!") + pubkey, checksum = pubkey.split(":") pubkey_byte = b58_decode(pubkey) checksum_calculed = b58_encode( hash.sha256( @@ -44,7 +44,7 @@ def check_public_key(pubkey, display_error): if checksum_calculed == checksum: return pubkey else: - print("Error: bad checksum for following public key:") + print("Error: Wrong checksum for following public key:") return False elif display_error: diff --git a/silkaj/tx.py b/silkaj/tx.py index 5aa89092..c0e6e742 100644 --- a/silkaj/tx.py +++ b/silkaj/tx.py @@ -76,7 +76,7 @@ from duniterpy.documents.transaction import OutputSource, Unlock, SIGParameter "-r", multiple=True, required=True, - help="Pubkey(s)’ recipients + optional checksum:\n-r <pubkey>[!checksum]\n\ + help="Pubkey(s)’ recipients + optional checksum:\n-r <pubkey>[:checksum]\n\ Sending to many recipients is possible:\n\ * With one amount, all will receive the amount\n\ * With many amounts (one per recipient)", @@ -84,7 +84,7 @@ Sending to many recipients is possible:\n\ @option("--comment", "-c", default="", help="Comment") @option( "--outputBackChange", - help="Pubkey recipient to send the rest of the transaction: <pubkey[!checksum]>", + help="Pubkey recipient to send the rest of the transaction: <pubkey[:checksum]>", ) @option("--yes", "-y", is_flag=True, help="Assume yes. Do not prompt confirmation") @coroutine -- GitLab