Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify card issuing error #2

Merged
merged 2 commits into from
Feb 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pacli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,14 @@ def card_issue(provider, args):
if not provider.getaddressesbyaccount(deck.name):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? I believe it's covered in this PR.

print("\n", {"error": "You are not even subscribed to this deck, how can you issue cards?"})
return
try:
utxo = provider.select_inputs(0.02, deck.issuer)
except ValueError:
print("\n", {"error": "You are not owner of this deck, you can not issue cards."})
if provider.validateaddress(deck.issuer)["ismine"]:
try:
utxo = provider.select_inputs(0.02, deck.issuer)
except ValueError:
print("\n", {"error": "Insufficient funds in issuing address."})
return
else:
print("\n", {"error": "You are not the owner of this deck."})
return

change_address = change(utxo)
Expand Down