From 3752d308976f5bc04b6a5f696a8529b6c47957d9 Mon Sep 17 00:00:00 2001 From: Mikko Ohtamaa Date: Thu, 10 Aug 2023 18:26:35 +0300 Subject: [PATCH] More diagnostics data --- eth_defi/confirmation.py | 2 +- eth_defi/hotwallet.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/eth_defi/confirmation.py b/eth_defi/confirmation.py index d172a8e0..b68fabb3 100644 --- a/eth_defi/confirmation.py +++ b/eth_defi/confirmation.py @@ -161,7 +161,7 @@ def broadcast_transactions( # Anvil/Ethereum tester immediately fail on the broadcast # ValueError: {'code': -32003, 'message': 'Insufficient funds for gas * price + value'} decoded_tx = decode_signed_transaction(tx.rawTransaction) - raise BroadcastFailure(f"Could not broadcast transaction: {decoded_tx}") from e + raise BroadcastFailure(f"Could not broadcast transaction: {tx.hash}. Transaction data: {decoded_tx}. JSON-RPC error: {e}") from e assert hash diff --git a/eth_defi/hotwallet.py b/eth_defi/hotwallet.py index 8b6d0228..8a8e55e1 100644 --- a/eth_defi/hotwallet.py +++ b/eth_defi/hotwallet.py @@ -74,6 +74,9 @@ def __init__(self, account: LocalAccount): self.account = account self.current_nonce: Optional[int] = None + def __repr__(self): + return f"" + @property def address(self): """Get address of the private key of the wallet."""