kisstron

KISS-friendly Tron CLI wallet
git clone git://git.luxferre.top/kisstron.git
Log | Files | Refs | README

commit a1fb8fdf5cc340cf688e564e92a195a768839460
parent db24b899521b06959ff4292b591cd35d10f2c85b
Author: Luxferre <lux@ferre>
Date:   Thu, 15 Feb 2024 17:39:01 +0200

Fixed false warning on mainnet

Diffstat:
Mkisstron.py | 19++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/kisstron.py b/kisstron.py @@ -288,6 +288,9 @@ def sendtrx(network: str, pk: str, toaddr: str, amt: float, except ValidationError as e: res['message'] = str(e) return res + except TransactionError as e: + res['message'] = str(e) + return res res['success'] = True res['message'] = 'Sent %f TRX to %s\nTransaction ID %s' % (amt, toaddr, receipt['id']) @@ -332,10 +335,10 @@ def sendtrc20(network: str, pk: str, ticker: str, toaddr: str, except ValidationError as e: res['message'] = str(e) return res - res['result'] = receipt - if receipt['receipt']['result'] == 'OUT_OF_ENERGY': - res['message'] = 'Not enough energy for transaction!' + except TransactionError as e: + res['message'] = str(e) return res + res['result'] = receipt res['success'] = True res['message'] = 'Sent %f %s to %s\nTransaction ID %s' % (amt, KT_TRC20_TOKENS[network][ticker]['ticker'], @@ -370,6 +373,9 @@ def freezetrx(network: str, pk: str, amt: float, offline: bool = False): except ValidationError as e: res['message'] = str(e) return res + except TransactionError as e: + res['message'] = str(e) + return res res['success'] = True res['message'] = 'Frozen %f TRX at %s\nTransaction ID %s' % (amt, myaddr, receipt['id']) @@ -405,6 +411,9 @@ def unfreezetrx(network: str, pk: str, amt: float, offline: bool = False): except ValidationError as e: res['message'] = str(e) return res + except TransactionError as e: + res['message'] = str(e) + return res res['success'] = True res['message'] = 'Unfrozen %f TRX at %s\nTransaction ID %s' % (amt, myaddr, receipt['id']) @@ -435,10 +444,6 @@ def broadcastjson(network, tjson): res['message'] = str(e) return res res['result'] = receipt - if ('receipt' in receipt and 'result' in receipt['receipt'] - and receipt['receipt']['result'] == 'OUT_OF_ENERGY'): - res['message'] = 'Not enough energy for transaction!' - return res res['success'] = True res['message'] = 'Transaction sent\nTransaction ID %s' % receipt['id'] return res