File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -221,13 +221,14 @@ def get_logs(
221
221
for i , block_number in enumerate (range (from_block , to_block + 1 )):
222
222
block = blocks [i ]
223
223
if i != 0 :
224
- assert block ["parentHash" ] == blocks [i - 1 ]["hash" ], f"{ blocks [i - 1 ]['hash' ].hex ()= } , { block ['parentHash' ].hex ()= } "
224
+ if block ["parentHash" ] != blocks [i - 1 ]["hash" ]:
225
+ raise ForkedBlock (f"expected={ blocks [i - 1 ]['hash' ].to_0x_hex ()} , actual={ block ['parentHash' ].to_0x_hex ()} " )
225
226
if from_block_body is not None and from_block_body ["number" ] == block_number :
226
227
if block ["hash" ] != from_block_body ["hash" ]:
227
- raise ForkedBlock (f"expected={ from_block_body ['hash' ].hex ()} , actual={ block ['hash' ].hex ()} " )
228
+ raise ForkedBlock (f"expected={ from_block_body ['hash' ].to_0x_hex ()} , actual={ block ['hash' ].to_0x_hex ()} " )
228
229
if to_block_body is not None and to_block_body ["number" ] == block_number :
229
230
if block ["hash" ] != to_block_body ["hash" ]:
230
- raise ForkedBlock (f"expected={ to_block_body ['hash' ].hex ()} , actual={ block ['hash' ].hex ()} " )
231
+ raise ForkedBlock (f"expected={ to_block_body ['hash' ].to_0x_hex ()} , actual={ block ['hash' ].to_0x_hex ()} " )
231
232
232
233
single_hash_filter = filter_params .copy ()
233
234
del single_hash_filter ["fromBlock" ]
You can’t perform that action at this time.
0 commit comments