solver-multirpc 3.1.8__tar.gz → 3.1.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solver-multirpc
3
- Version: 3.1.8
3
+ Version: 3.1.10
4
4
  Summary: A robust Python library for interacting with Ethereum smart contracts via multiple RPC endpoints, ensuring reliability, availability, and load distribution with automatic retries on failure.
5
5
  License: MIT
6
6
  Author: rorschach
@@ -16,7 +16,7 @@ from requests import ConnectionError, HTTPError, ReadTimeout
16
16
  from web3 import AsyncWeb3, Web3
17
17
  from web3._utils.contracts import encode_transaction_data # noqa
18
18
  from web3.contract import Contract
19
- from web3.exceptions import BadResponseFormat, BlockNotFound, TimeExhausted, TransactionNotFound
19
+ from web3.exceptions import BadResponseFormat, BlockNotFound, TimeExhausted, TransactionNotFound, Web3RPCError
20
20
  from web3.types import BlockData, BlockIdentifier, TxReceipt
21
21
 
22
22
  from .constants import EstimateGasLimitBuffer, GasLimit, GasUpperBound, MultiRPCLogger, ViewPolicy
@@ -311,7 +311,7 @@ class BaseMultiRpc(ABC):
311
311
  self._logger_params(**{f"{rpc_label_prefix}_post_send_time": get_unix_time()})
312
312
  self._logger_params(tx_send_time=int(time.time() * 1000))
313
313
  return provider, transaction
314
- except ValueError as e:
314
+ except (ValueError, Web3RPCError) as e:
315
315
  MultiRPCLogger.error(f"RPC({rpc_url}) value error: {str(e)}")
316
316
  t_bnb_flag = "transaction would cause overdraft" in str(e).lower() and (await provider.eth.chain_id) == 97
317
317
  if not (
@@ -492,7 +492,7 @@ class BaseMultiRpc(ABC):
492
492
  ]
493
493
  result = await self.__execute_batch_tasks(
494
494
  execution_tx_list,
495
- [ValueError, ConnectionError, ReadTimeout, HTTPError],
495
+ [ValueError, ConnectionError, ReadTimeout, HTTPError, Web3RPCError],
496
496
  FailedOnAllRPCs
497
497
  )
498
498
  provider, tx = result
@@ -5,6 +5,8 @@ BaseException_ = Exception
5
5
 
6
6
  class Web3InterfaceException(BaseException_):
7
7
  def __str__(self):
8
+ if not self.args:
9
+ return f"{self.__class__.__name__}()"
8
10
  return f"{self.__class__.__name__}({self.args[0]})"
9
11
 
10
12
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "solver-multirpc"
3
- version = "3.1.8"
3
+ version = "3.1.10"
4
4
  description = "A robust Python library for interacting with Ethereum smart contracts via multiple RPC endpoints, ensuring reliability, availability, and load distribution with automatic retries on failure."
5
5
  authors = ["rorschach <rorschach45001@gmail.com>"]
6
6
  license = "MIT"