Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
DuniterPy
Commits
36572ae8
Commit
36572ae8
authored
6 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod]
#71
: rm from_seed, and save_seedhex_file
- rename save_seedhex_file_from_seed to save_seedhex_file
parent
f6cedec6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!54
#71: handle seedhex
Pipeline
#4405
passed
6 years ago
Stage: github-sync
Stage: build
Stage: test
Stage: release
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
duniterpy/key/signing_key.py
+3
-22
3 additions, 22 deletions
duniterpy/key/signing_key.py
with
3 additions
and
22 deletions
duniterpy/key/signing_key.py
+
3
−
22
View file @
36572ae8
...
@@ -68,23 +68,13 @@ class SigningKey(libnacl.sign.Signer):
...
@@ -68,23 +68,13 @@ class SigningKey(libnacl.sign.Signer):
return
cls
(
seed
)
return
cls
(
seed
)
def
save_seedhex_file
_from_seed
(
self
,
path
:
str
)
->
None
:
def
save_seedhex_file
(
self
,
path
:
str
)
->
None
:
"""
"""
Save hexadecimal seed file from seed
Save hexadecimal seed file from seed
:param path: Authentication file path
:param path: Authentication file path
"""
"""
seedhex
=
convert_seed_to_seedhex
(
self
.
seed
)
seedhex
=
convert_seed_to_seedhex
(
self
.
seed
)
SigningKey
.
save_seedhex_file
(
seedhex
,
path
)
@staticmethod
def
save_seedhex_file
(
seedhex
:
str
,
path
:
str
)
->
None
:
"""
Save hexadecimal seed file
:param seedhex: Hexadecimal seed string
:param path: Authentication file path
"""
with
open
(
path
,
'
w
'
)
as
fh
:
with
open
(
path
,
'
w
'
)
as
fh
:
fh
.
write
(
seedhex
)
fh
.
write
(
seedhex
)
...
@@ -99,8 +89,8 @@ class SigningKey(libnacl.sign.Signer):
...
@@ -99,8 +89,8 @@ class SigningKey(libnacl.sign.Signer):
seedhex
=
fh
.
read
()
seedhex
=
fh
.
read
()
return
SigningKey
.
from_seedhex
(
seedhex
)
return
SigningKey
.
from_seedhex
(
seedhex
)
@
static
method
@
class
method
def
from_seedhex
(
seedhex
:
str
)
->
SigningKeyType
:
def
from_seedhex
(
cls
:
Type
[
SigningKeyType
],
seedhex
:
str
)
->
SigningKeyType
:
"""
"""
Return SigningKey instance from Seedhex
Return SigningKey instance from Seedhex
...
@@ -112,15 +102,6 @@ class SigningKey(libnacl.sign.Signer):
...
@@ -112,15 +102,6 @@ class SigningKey(libnacl.sign.Signer):
raise
Exception
(
'
Error: Bad seed hexadecimal format
'
)
raise
Exception
(
'
Error: Bad seed hexadecimal format
'
)
seedhex
=
match
.
groups
()[
0
]
seedhex
=
match
.
groups
()[
0
]
seed
=
convert_seedhex_to_seed
(
seedhex
)
seed
=
convert_seedhex_to_seed
(
seedhex
)
return
SigningKey
.
from_seed
(
seed
)
@classmethod
def
from_seed
(
cls
:
Type
[
SigningKeyType
],
seed
:
bytes
)
->
SigningKeyType
:
"""
Return SigningKey instance from Seed
:param str seed: seed string
"""
return
cls
(
seed
)
return
cls
(
seed
)
def
save_private_key
(
self
,
path
:
str
)
->
None
:
def
save_private_key
(
self
,
path
:
str
)
->
None
:
...
...
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