Skip to content

Commit

Permalink
Fix type hint for dict in the example doc (#2469)
Browse files Browse the repository at this point in the history
* Fix type hint for dict in the example doc
  • Loading branch information
kaiix authored and pacrob committed May 23, 2022
1 parent 7b952d4 commit 7f525d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ The script can be run with: ``python ./eventscanner.py <your JSON-RPC API URL>``
import time
import logging
from abc import ABC, abstractmethod
from typing import Tuple, Optional, Callable, List, Iterable
from typing import Tuple, Optional, Callable, List, Iterable, Dict, Any
from web3 import Web3
from web3.contract import Contract
Expand Down Expand Up @@ -865,7 +865,7 @@ The script can be run with: ``python ./eventscanner.py <your JSON-RPC API URL>``
because it cannot correctly throttle and decrease the `eth_getLogs` block number range.
"""
def __init__(self, w3: Web3, contract: Contract, state: EventScannerState, events: List, filters: {},
def __init__(self, w3: Web3, contract: Contract, state: EventScannerState, events: List, filters: Dict[str, Any],
max_chunk_scan_size: int = 10000, max_request_retries: int = 30, request_retry_seconds: float = 3.0):
"""
:param contract: Contract
Expand Down Expand Up @@ -1130,7 +1130,7 @@ The script can be run with: ``python ./eventscanner.py <your JSON-RPC API URL>``
def _fetch_events_for_all_contracts(
w3,
event,
argument_filters: dict,
argument_filters: Dict[str, Any],
from_block: int,
to_block: int) -> Iterable:
"""Get events using eth_getLogs API.
Expand Down Expand Up @@ -1363,7 +1363,7 @@ The script can be run with: ``python ./eventscanner.py <your JSON-RPC API URL>``
state = JSONifiedState()
state.restore()
# chain_id: int, w3: Web3, abi: dict, state: EventScannerState, events: List, filters: {}, max_chunk_scan_size: int=10000
# chain_id: int, w3: Web3, abi: Dict, state: EventScannerState, events: List, filters: Dict, max_chunk_scan_size: int=10000
scanner = EventScanner(
w3=w3,
contract=ERC20,
Expand Down
1 change: 1 addition & 0 deletions newsfragments/2469.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix dict type hints in EventScanner example

0 comments on commit 7f525d7

Please sign in to comment.