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
64773a4d
Commit
64773a4d
authored
4 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod] Introduce has_auth_method() used in `balance`
parent
803172d1
No related branches found
No related tags found
2 merge requests
!146
Merge dev into master branch to complete v0.8.0 development cycle
,
!143
#301: Generalize pubkey checksum display and check
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
silkaj/auth.py
+10
-0
10 additions, 0 deletions
silkaj/auth.py
silkaj/money.py
+2
-7
2 additions, 7 deletions
silkaj/money.py
with
12 additions
and
7 deletions
silkaj/auth.py
+
10
−
0
View file @
64773a4d
...
...
@@ -46,6 +46,16 @@ def auth_method(ctx):
return
auth_by_scrypt
()
@pass_context
def
has_auth_method
(
ctx
):
return
(
ctx
.
obj
[
"
AUTH_SCRYPT
"
]
or
ctx
.
obj
[
"
AUTH_FILE
"
]
or
ctx
.
obj
[
"
AUTH_SEED
"
]
or
ctx
.
obj
[
"
AUTH_WIF
"
]
)
@command
(
"
authfile
"
,
help
=
"
Generate authentication file
"
)
@option
(
"
--file
"
,
default
=
"
authfile
"
,
show_default
=
True
,
help
=
"
Path file
"
)
def
generate_auth_file
(
file
):
...
...
This diff is collapsed.
Click to expand it.
silkaj/money.py
+
2
−
7
View file @
64773a4d
...
...
@@ -21,7 +21,7 @@ from tabulate import tabulate
from
silkaj.network_tools
import
ClientInstance
from
silkaj.blockchain_tools
import
HeadBlock
from
silkaj.tools
import
CurrencySymbol
,
message_exit
,
coroutine
from
silkaj.auth
import
auth_method
from
silkaj.auth
import
auth_method
,
has_auth_method
# had to import wot to prevent loop dependency. No use here.
from
silkaj
import
wot
...
...
@@ -38,12 +38,7 @@ from duniterpy.documents.transaction import InputSource
@coroutine
async
def
cmd_amount
(
ctx
,
pubkeys
):
client
=
ClientInstance
().
client
if
not
(
ctx
.
obj
[
"
AUTH_SCRYPT
"
]
or
ctx
.
obj
[
"
AUTH_FILE
"
]
or
ctx
.
obj
[
"
AUTH_SEED
"
]
or
ctx
.
obj
[
"
AUTH_WIF
"
]
):
if
not
has_auth_method
():
if
not
pubkeys
:
message_exit
(
"
You should specify one or many pubkeys
"
)
pubkey_list
=
list
()
...
...
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