Skip to content
Snippets Groups Projects
Commit 409ce3ba authored by Moul's avatar Moul Committed by Vincent Texier
Browse files

[enh] tx example: create key earlier in order to gather pubkey rather than asking for it.

parent 9de2a5ee
No related branches found
No related tags found
No related merge requests found
...@@ -96,8 +96,9 @@ async def main(): ...@@ -96,8 +96,9 @@ async def main():
# prompt hidden user entry # prompt hidden user entry
password = getpass.getpass("Enter your password: ") password = getpass.getpass("Enter your password: ")
# prompt entry # create keys from credentials
pubkey_from = input("Enter your pubkey: ") key = SigningKey.from_credentials(salt, password)
pubkey_from = key.pubkey
# prompt entry # prompt entry
pubkey_to = input("Enter recipient pubkey: ") pubkey_to = input("Enter recipient pubkey: ")
...@@ -118,9 +119,6 @@ async def main(): ...@@ -118,9 +119,6 @@ async def main():
# create the transaction document # create the transaction document
transaction = get_transaction_document(current_block, source, pubkey_from, pubkey_to) transaction = get_transaction_document(current_block, source, pubkey_from, pubkey_to)
# create keys from credentials
key = SigningKey.from_credentials(salt, password)
# sign document # sign document
transaction.sign([key]) transaction.sign([key])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment