From 7160eb15def5ad26ad8a3f0e015695fccde605e6 Mon Sep 17 00:00:00 2001 From: saeveritt Date: Tue, 21 Feb 2017 17:47:52 +0000 Subject: [PATCH 1/2] Specify card issuing error --- pacli/__main__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pacli/__main__.py b/pacli/__main__.py index 412700a..a181250 100644 --- a/pacli/__main__.py +++ b/pacli/__main__.py @@ -285,10 +285,14 @@ def card_issue(provider, args): if not provider.getaddressesbyaccount(deck.name): 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) From 8e56c0109a3994fa704db4f06c15647332ce029e Mon Sep 17 00:00:00 2001 From: saeveritt Date: Tue, 21 Feb 2017 17:57:48 +0000 Subject: [PATCH 2/2] remove redundant check --- pacli/__main__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pacli/__main__.py b/pacli/__main__.py index a181250..9af6721 100644 --- a/pacli/__main__.py +++ b/pacli/__main__.py @@ -282,14 +282,11 @@ def card_issue(provider, args): except IndexError: print("\n", {"error": "Deck not found."}) return - if not provider.getaddressesbyaccount(deck.name): - print("\n", {"error": "You are not even subscribed to this deck, how can you issue cards?"}) - return 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."}) + print("\n", {"error": "Please send funds to the issuing address."}) return else: print("\n", {"error": "You are not the owner of this deck."})