Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
19098298
Commit
19098298
authored
4 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod]
#237
: Move back to ':' pubkey and checksum delimiter
Update parsing, help. Change word
parent
83f80834
No related branches found
Branches containing commit
Tags
v1.4.3
Tags containing commit
No related merge requests found
Pipeline
#9282
passed
4 years ago
Stage: checks
Stage: tests
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
silkaj/crypto_tools.py
+3
-3
3 additions, 3 deletions
silkaj/crypto_tools.py
silkaj/tx.py
+2
-2
2 additions, 2 deletions
silkaj/tx.py
with
5 additions
and
5 deletions
silkaj/crypto_tools.py
+
3
−
3
View file @
19098298
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
silkaj/tx.py
+
2
−
2
View file @
19098298
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment