Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit fe26674

Browse files
committed
more pylint fixes
1 parent 986f286 commit fe26674

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/sync/batch_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from dotenv import load_dotenv
44
from dune_client.client import DuneClient
5-
import web3
5+
from web3 import Web3
66
from src.fetch.orderbook import OrderbookFetcher
77
from src.logger import set_log
88
from src.sync.config import BatchDataSyncConfig
@@ -14,7 +14,7 @@
1414

1515

1616
async def sync_batch_data(
17-
node: web3,
17+
node: Web3,
1818
orderbook: OrderbookFetcher,
1919
dune: DuneClient,
2020
config: BatchDataSyncConfig,

src/sync/common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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

7068
def compute_block_and_month_range(node: Web3): # pylint: disable=too-many-locals

0 commit comments

Comments
 (0)