Add raw tx to error logging when tx send fails

This commit is contained in:
nolash
2021-01-27 13:33:52 +01:00
parent e6072da8e4
commit c8ce2659a3
5 changed files with 20 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ import logging
# local imports
from crypto_dev_signer.helper import TxExecutor
from crypto_dev_signer.error import NetworkError
logg = logging.getLogger()
logging.getLogger('web3').setLevel(logging.CRITICAL)
@@ -30,7 +31,14 @@ class EthTxExecutor(TxExecutor):
def dispatcher(self, tx):
return self.w3.eth.sendRawTransaction(tx)
error_object = None
try:
tx_hash = self.w3.eth.sendRawTransaction(tx)
except ValueError as e:
error_object = e.args[0]
logg.error('node could not intepret rlp {}'.format(tx))
if error_object != None:
raise NetworkError(error_object)
def reporter(self, tx):