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
2a530a11
Commit
2a530a11
authored
4 years ago
by
matograine
Browse files
Options
Downloads
Patches
Plain Diff
[enh]
#301
display pubkeys checksums while sending a transaction
parent
870cb0af
No related branches found
No related tags found
No related merge requests found
Pipeline
#9753
passed
4 years ago
Stage: checks
Stage: tests
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
silkaj/tx.py
+11
-5
11 additions, 5 deletions
silkaj/tx.py
with
11 additions
and
5 deletions
silkaj/tx.py
+
11
−
5
View file @
2a530a11
...
@@ -34,7 +34,7 @@ from silkaj.constants import (
...
@@ -34,7 +34,7 @@ from silkaj.constants import (
CENT_MULT_TO_UNIT
,
CENT_MULT_TO_UNIT
,
ASYNC_SLEEP
,
ASYNC_SLEEP
,
)
)
from
silkaj.tui
import
display_amount
,
display_pubkey
from
silkaj.tui
import
display_amount
,
display_pubkey
,
pubkey_with_checksum
from
duniterpy.api.bma.tx
import
process
from
duniterpy.api.bma.tx
import
process
from
duniterpy.documents
import
BlockUID
,
Transaction
from
duniterpy.documents
import
BlockUID
,
Transaction
...
@@ -211,10 +211,11 @@ def check_transaction_values(
...
@@ -211,10 +211,11 @@ def check_transaction_values(
pubkey
=
outputBackChange
pubkey
=
outputBackChange
outputBackChange
=
check_public_key
(
outputBackChange
,
True
)
outputBackChange
=
check_public_key
(
outputBackChange
,
True
)
if
not
outputBackChange
:
if
not
outputBackChange
:
message_exit
(
pubkey
)
message_exit
(
pubkey
_with_checksum
(
pubkey
)
)
if
enough_source
:
if
enough_source
:
message_exit
(
message_exit
(
issuer_pubkey
+
"
pubkey doesn’t have enough money for this transaction.
"
pubkey_with_checksum
(
issuer_pubkey
)
+
"
pubkey doesn’t have enough money for this transaction.
"
)
)
return
outputBackChange
return
outputBackChange
...
@@ -351,7 +352,7 @@ async def generate_and_send_transaction(
...
@@ -351,7 +352,7 @@ async def generate_and_send_transaction(
print
(
"
Generate Change Transaction
"
)
print
(
"
Generate Change Transaction
"
)
else
:
else
:
print
(
"
Generate Transaction:
"
)
print
(
"
Generate Transaction:
"
)
print
(
"
- From:
"
+
issuers
)
print
(
"
- From:
"
+
pubkey_with_checksum
(
issuers
)
)
for
tx_amount
,
outputAddress
in
zip
(
tx_amounts
,
outputAddresses
):
for
tx_amount
,
outputAddress
in
zip
(
tx_amounts
,
outputAddresses
):
display_sent_tx
(
outputAddress
,
tx_amount
)
display_sent_tx
(
outputAddress
,
tx_amount
)
print
(
"
- Total:
"
+
str
(
sum
(
tx_amounts
)
/
100
))
print
(
"
- Total:
"
+
str
(
sum
(
tx_amounts
)
/
100
))
...
@@ -376,7 +377,12 @@ async def generate_and_send_transaction(
...
@@ -376,7 +377,12 @@ async def generate_and_send_transaction(
def
display_sent_tx
(
outputAddress
,
amount
):
def
display_sent_tx
(
outputAddress
,
amount
):
print
(
"
- To:
"
,
outputAddress
,
"
\n
- Amount:
"
,
amount
/
100
)
print
(
"
- To:
"
,
pubkey_with_checksum
(
outputAddress
),
"
\n
- Amount:
"
,
amount
/
100
,
)
async
def
generate_transaction_document
(
async
def
generate_transaction_document
(
...
...
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