solver-multirpc 3.1.11__py3-none-any.whl → 3.1.13__py3-none-any.whl
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.
- multirpc/base_multi_rpc_interface.py +5 -4
- multirpc/tx_trace.py +12 -5
- {solver_multirpc-3.1.11.dist-info → solver_multirpc-3.1.13.dist-info}/METADATA +1 -1
- {solver_multirpc-3.1.11.dist-info → solver_multirpc-3.1.13.dist-info}/RECORD +5 -5
- {solver_multirpc-3.1.11.dist-info → solver_multirpc-3.1.13.dist-info}/WHEEL +0 -0
|
@@ -351,7 +351,7 @@ class BaseMultiRpc(ABC):
|
|
|
351
351
|
raise
|
|
352
352
|
|
|
353
353
|
@staticmethod
|
|
354
|
-
def _handle_tx_trace(trace: TxTrace, func_name: str, func_args: Tuple, func_kwargs: Dict):
|
|
354
|
+
def _handle_tx_trace(trace: TxTrace, func_name: str, func_args: Tuple, func_kwargs: Dict) -> Exception | None:
|
|
355
355
|
"""
|
|
356
356
|
You can override this method to customize handling failed transaction.
|
|
357
357
|
|
|
@@ -391,11 +391,12 @@ class BaseMultiRpc(ABC):
|
|
|
391
391
|
tx_err_count += 1
|
|
392
392
|
timeout *= 2
|
|
393
393
|
|
|
394
|
-
@
|
|
395
|
-
async def __get_tx_trace(tx, provider_url, func_name=None, func_args=None, func_kwargs=None):
|
|
394
|
+
@classmethod
|
|
395
|
+
async def __get_tx_trace(cls, tx, provider_url, func_name=None, func_args=None, func_kwargs=None):
|
|
396
396
|
tx_hash = Web3.to_hex(tx)
|
|
397
397
|
trace = TxTrace(tx_hash, provider_url)
|
|
398
|
-
|
|
398
|
+
if exception := cls._handle_tx_trace(trace, func_name, func_args, func_kwargs):
|
|
399
|
+
return exception
|
|
399
400
|
return TransactionFailedStatus(tx_hash, func_name, func_args, func_kwargs, trace)
|
|
400
401
|
|
|
401
402
|
@staticmethod
|
multirpc/tx_trace.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
1
3
|
import requests
|
|
2
4
|
|
|
3
5
|
from multirpc.constants import MultiRPCLogger
|
|
@@ -64,12 +66,17 @@ class TxTrace:
|
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
response = requests.post(self.rpc, json=data)
|
|
69
|
+
try:
|
|
70
|
+
json_response = response.json()
|
|
71
|
+
except json.decoder.JSONDecodeError:
|
|
72
|
+
MultiRPCLogger.error(f'tx_trace({self.tx_hash}) invalid JSON response: {response.text[:200]}')
|
|
73
|
+
return None
|
|
67
74
|
if response.status_code == 200:
|
|
68
|
-
if error :=
|
|
75
|
+
if error := json_response.get('error'):
|
|
69
76
|
MultiRPCLogger.error(f'failed to get tx({self.tx_hash}) trace with error: {error}')
|
|
70
77
|
return None
|
|
71
78
|
return response
|
|
72
|
-
MultiRPCLogger.error(f'tx_trace({self.tx_hash}) status = {response.status_code}, \n {
|
|
79
|
+
MultiRPCLogger.error(f'tx_trace({self.tx_hash}) status = {response.status_code}, \n {json_response}')
|
|
73
80
|
|
|
74
81
|
except requests.HTTPError:
|
|
75
82
|
MultiRPCLogger.exception('Exception in debug_traceTransaction')
|
|
@@ -146,8 +153,8 @@ class TxTraceResult:
|
|
|
146
153
|
def first_usable_error(self):
|
|
147
154
|
for error in [self.error()] + self.all_revert_reasons():
|
|
148
155
|
if error and \
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
'execution reverted' not in error and \
|
|
157
|
+
'MultiAccount: Error occurred' not in error and \
|
|
158
|
+
'Execution reverted' not in error:
|
|
152
159
|
return error
|
|
153
160
|
return ''
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: solver-multirpc
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.13
|
|
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
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
multirpc/__init__.py,sha256=f7h3txKkb_WQX6u-PzbgMpHt1VGqA0OjhrSe4Vdsk5I,100
|
|
2
2
|
multirpc/async_multi_rpc_interface.py,sha256=NTwdOyMbghekredlYR64kr0eiPRxzvUirGBZpFzRgig,5699
|
|
3
|
-
multirpc/base_multi_rpc_interface.py,sha256=
|
|
3
|
+
multirpc/base_multi_rpc_interface.py,sha256=CfpujqGLgb9RmqnHQYExzq1duShfstWRHNo1EoywrhM,29299
|
|
4
4
|
multirpc/constants.py,sha256=B21pS85Vnm65vvjt25_9TTxviRHYCUlgpIDGOrs1rmg,1262
|
|
5
5
|
multirpc/exceptions.py,sha256=Tfi4aHeOiH1OaYeNBEDX3fJNAUyPgs42VXrRG62IgJs,1937
|
|
6
6
|
multirpc/gas_estimation.py,sha256=k0FVO9FgSRuRQhEkQ9YZZ-rSpW_zxaLLFdMAYOF3xco,7276
|
|
7
7
|
multirpc/sync_multi_rpc_interface.py,sha256=Zs3FVSGNJDhrFBi3m9sn4pMuYGzLwaiz0qy_R9VIo04,5888
|
|
8
|
-
multirpc/tx_trace.py,sha256=
|
|
8
|
+
multirpc/tx_trace.py,sha256=aAx2AzjWsHgnqPtFCbBPPBOdeD-_qGDdEWrfP0HJc-Q,8135
|
|
9
9
|
multirpc/utils.py,sha256=bhrP15IY_TOB1dK8HP35rRxs9FIIWKoSUY6EVOA4FEA,9073
|
|
10
|
-
solver_multirpc-3.1.
|
|
11
|
-
solver_multirpc-3.1.
|
|
12
|
-
solver_multirpc-3.1.
|
|
10
|
+
solver_multirpc-3.1.13.dist-info/METADATA,sha256=LTMz3PntqyL9CG7cRE7-Z2u_MOlBhAkojiYCVj3glog,8287
|
|
11
|
+
solver_multirpc-3.1.13.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
12
|
+
solver_multirpc-3.1.13.dist-info/RECORD,,
|
|
File without changes
|