File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,7 @@ def get_logs(
188
188
chain_id = self .chain_id ,
189
189
filter_params = filter_params ,
190
190
partial_allowed = True ,
191
+ p_bar = p_bar ,
191
192
)
192
193
if till_block >= to_block :
193
194
return results
Original file line number Diff line number Diff line change 1
1
import requests
2
2
from eth_utils import to_checksum_address
3
3
from hexbytes import HexBytes
4
+ from tqdm import tqdm
4
5
from web3 .types import FilterParams , LogReceipt
5
6
6
7
ENDPOINTS = {
@@ -113,7 +114,8 @@ def get_text(url: str) -> str:
113
114
def get_filter (
114
115
chain_id : int ,
115
116
filter_params : FilterParams ,
116
- partial_allowed = False
117
+ partial_allowed = False ,
118
+ p_bar : tqdm = None
117
119
) -> tuple [int , list [LogReceipt ]]:
118
120
if chain_id not in ENDPOINTS :
119
121
raise ValueError (f"Subsquid does not support Chain ID { chain_id } " )
@@ -176,6 +178,8 @@ def get_filter(
176
178
blocks = res .json ()
177
179
178
180
last_processed_block = blocks [- 1 ]['header' ]['number' ]
181
+ if p_bar is not None :
182
+ p_bar .update (last_processed_block - from_block + 1 )
179
183
from_block = last_processed_block + 1
180
184
181
185
for block in blocks :
You can’t perform that action at this time.
0 commit comments