solver-multirpc 3.1.12__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/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 := response.json().get('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 {response.json()}')
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
- 'execution reverted' not in error and \
150
- 'MultiAccount: Error occurred' not in error and \
151
- 'Execution reverted' not in error:
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.12
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
@@ -5,8 +5,8 @@ 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=G7sTVMzALtTeC1F2JjxMSGRRFlmAAZG-Sdhd4UQtfw8,7885
8
+ multirpc/tx_trace.py,sha256=aAx2AzjWsHgnqPtFCbBPPBOdeD-_qGDdEWrfP0HJc-Q,8135
9
9
  multirpc/utils.py,sha256=bhrP15IY_TOB1dK8HP35rRxs9FIIWKoSUY6EVOA4FEA,9073
10
- solver_multirpc-3.1.12.dist-info/METADATA,sha256=3iUpdvykagcoL95aqMoHbEiG8srT9fhK43YYO2vVs70,8287
11
- solver_multirpc-3.1.12.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
12
- solver_multirpc-3.1.12.dist-info/RECORD,,
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,,