This repository was archived by the owner on Dec 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 22import os
33from dotenv import load_dotenv
44from dune_client .client import DuneClient
5- import web3
5+ from web3 import Web3
66from src .fetch .orderbook import OrderbookFetcher
77from src .logger import set_log
88from src .sync .config import BatchDataSyncConfig
1414
1515
1616async def sync_batch_data (
17- node : web3 ,
17+ node : Web3 ,
1818 orderbook : OrderbookFetcher ,
1919 dune : DuneClient ,
2020 config : BatchDataSyncConfig ,
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def node_suffix(network: str) -> str:
3434 return ""
3535
3636
37- def find_block_with_timestamp (node , time_stamp ) -> int :
37+ def find_block_with_timestamp (node : Web3 , time_stamp : float ) -> int :
3838 """
3939 This implements binary search and returns the smallest block number
4040 whose timestamp is at least as large as the time_stamp argument passed in the function
@@ -62,9 +62,7 @@ def find_block_with_timestamp(node, time_stamp) -> int:
6262 block = node .eth .get_block (b )
6363 block_time_stamp = block .timestamp
6464 if block_time_stamp >= time_stamp :
65- return block .number
66- # fallback if correct block is not found
67- return mid_block_number + 200
65+ return int (block .number )
6866
6967
7068def compute_block_and_month_range (node : Web3 ): # pylint: disable=too-many-locals
You can’t perform that action at this time.
0 commit comments