commit 05d977427e04b6b9918eeedbc387bc0bd2134770
parent a1fb8fdf5cc340cf688e564e92a195a768839460
Author: Luxferre <lux@ferre>
Date: Thu, 15 Feb 2024 17:46:13 +0200
Revert "Fixed false warning on mainnet"
This reverts commit a1fb8fdf5cc340cf688e564e92a195a768839460.
Diffstat:
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/kisstron.py b/kisstron.py
@@ -288,9 +288,6 @@ 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'])
@@ -335,10 +332,10 @@ def sendtrc20(network: str, pk: str, ticker: str, toaddr: str,
except ValidationError as e:
res['message'] = str(e)
return res
- except TransactionError 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!'
+ return res
res['success'] = True
res['message'] = 'Sent %f %s to %s\nTransaction ID %s' % (amt,
KT_TRC20_TOKENS[network][ticker]['ticker'],
@@ -373,9 +370,6 @@ 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'])
@@ -411,9 +405,6 @@ 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'])
@@ -444,6 +435,10 @@ 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