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
706d0cc5
Commit
706d0cc5
authored
4 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod]
#172
: balance: Properly name variables
To represent what they contain: - value -> inputs_balance - amount -> balance
parent
84410535
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
silkaj/money.py
+9
-9
9 additions, 9 deletions
silkaj/money.py
with
9 additions
and
9 deletions
silkaj/money.py
+
9
−
9
View file @
706d0cc5
...
@@ -48,10 +48,10 @@ async def cmd_amount(ctx, pubkeys):
...
@@ -48,10 +48,10 @@ async def cmd_amount(ctx, pubkeys):
return
return
total
=
[
0
,
0
]
total
=
[
0
,
0
]
for
pubkey
in
pubkeys
:
for
pubkey
in
pubkeys
:
valu
e
=
await
get_amount_from_pubkey
(
pubkey
)
inputs_balanc
e
=
await
get_amount_from_pubkey
(
pubkey
)
await
show_amount_from_pubkey
(
pubkey
,
valu
e
)
await
show_amount_from_pubkey
(
pubkey
,
inputs_balanc
e
)
total
[
0
]
+=
valu
e
[
0
]
total
[
0
]
+=
inputs_balanc
e
[
0
]
total
[
1
]
+=
valu
e
[
1
]
total
[
1
]
+=
inputs_balanc
e
[
1
]
if
len
(
pubkeys
)
>
1
:
if
len
(
pubkeys
)
>
1
:
await
show_amount_from_pubkey
(
"
Total
"
,
total
)
await
show_amount_from_pubkey
(
"
Total
"
,
total
)
else
:
else
:
...
@@ -61,21 +61,21 @@ async def cmd_amount(ctx, pubkeys):
...
@@ -61,21 +61,21 @@ async def cmd_amount(ctx, pubkeys):
await
client
.
close
()
await
client
.
close
()
async
def
show_amount_from_pubkey
(
pubkey
,
valu
e
):
async
def
show_amount_from_pubkey
(
pubkey
,
inputs_balanc
e
):
totalAmountInput
=
valu
e
[
0
]
totalAmountInput
=
inputs_balanc
e
[
0
]
amount
=
valu
e
[
1
]
balance
=
inputs_balanc
e
[
1
]
currency_symbol
=
await
CurrencySymbol
().
symbol
currency_symbol
=
await
CurrencySymbol
().
symbol
ud_value
=
await
UDValue
().
ud_value
ud_value
=
await
UDValue
().
ud_value
average
,
monetary_mass
=
await
get_average
()
average
,
monetary_mass
=
await
get_average
()
# display balance table
# display balance table
display
=
list
()
display
=
list
()
display
.
append
([
"
Balance of pubkey
"
,
pubkey
])
display
.
append
([
"
Balance of pubkey
"
,
pubkey
])
if
totalAmountInput
-
amount
!=
0
:
if
totalAmountInput
-
balance
!=
0
:
display_amount
(
display
,
"
Blockchain
"
,
amount
,
ud_value
,
currency_symbol
)
display_amount
(
display
,
"
Blockchain
"
,
amount
,
ud_value
,
currency_symbol
)
display_amount
(
display_amount
(
display
,
display
,
"
Pending transaction
"
,
"
Pending transaction
"
,
(
totalAmountInput
-
amount
),
(
totalAmountInput
-
balance
),
ud_value
,
ud_value
,
currency_symbol
,
currency_symbol
,
)
)
...
...
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