Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update starknetpy and typing #1103

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 51 additions & 51 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ ecdsa==0.18.0
email-validator==2.2.0; python_version ~= "3.11"
eth-abi==5.1.0
eth-account==0.13.3
eth-hash==0.7.0
eth-hash[pycryptodome]==0.7.0
eth-keyfile==0.8.1
eth-keys==0.5.1
Expand Down Expand Up @@ -62,9 +61,8 @@ platformdirs==4.2.2
poseidon-py==0.1.5
prometheus-client==0.20.0
pycryptodome==3.20.0
pydantic==2.9.1
pydantic-core==2.23.3
pydantic[email]==2.9.1; python_version ~= "3.11"
pydantic-core==2.23.4
pydantic[email]==2.9.2; python_version ~= "3.11"
pyhumps==3.8.0
pypika-tortoise==0.1.6
pysignalr==1.0.0
Expand All @@ -83,7 +81,7 @@ sentry-sdk==2.12.0
six==1.16.0
sniffio==1.3.1
sqlparse==0.5.1
starknet-py==0.24.1
starknet-py==0.24.2
strict-rfc3339==0.7
survey==5.4.0
sympy==1.11.1
Expand Down
12 changes: 6 additions & 6 deletions src/dipdup/abi/cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
from dipdup.utils import touch

if TYPE_CHECKING:
from starknet_py.abi.v2 import Abi # type: ignore[import-untyped]
from starknet_py.cairo.data_types import CairoType # type: ignore[import-untyped]
from starknet_py.abi.v2.model import Abi
from starknet_py.cairo.data_types import CairoType
from starknet_py.cairo.data_types import EventType
from starknet_py.serialization import PayloadSerializer # type: ignore[import-untyped]
from starknet_py.serialization.data_serializers.payload_serializer import PayloadSerializer

from dipdup.package import DipDupPackage

Expand Down Expand Up @@ -63,8 +63,8 @@ def sn_keccak(x: str) -> str:
@cache
def _loaded_abis(package: DipDupPackage) -> dict[str, Abi]:

from starknet_py.abi.v2 import AbiParser
from starknet_py.abi.v2 import AbiParsingError
from starknet_py.abi.v2.parser import AbiParser
from starknet_py.abi.v2.parser import AbiParsingError

result = {}
for abi_path in package.cairo_abi_paths:
Expand All @@ -81,7 +81,7 @@ def _loaded_abis(package: DipDupPackage) -> dict[str, Abi]:


def convert_abi(package: DipDupPackage) -> dict[str, CairoAbi]:
from starknet_py.serialization import serializer_for_event
from starknet_py.serialization.factory import serializer_for_event

abi_by_typename: dict[str, CairoAbi] = {}

Expand Down
8 changes: 4 additions & 4 deletions src/dipdup/datasources/_starknetpy.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Any

from starknet_py.net.full_node_client import FullNodeClient # type: ignore[import-untyped]
from starknet_py.net.http_client import HttpMethod # type: ignore[import-untyped]
from starknet_py.net.full_node_client import FullNodeClient
from starknet_py.net.http_client import HttpMethod
from starknet_py.net.http_client import RpcHttpClient

from dipdup.datasources import Datasource
from dipdup.exceptions import FrameworkException


class ProxyHttpClient(RpcHttpClient): # type: ignore[misc]
class ProxyHttpClient(RpcHttpClient):
def __init__(self, datasource: Datasource[Any]) -> None:
super().__init__(datasource.url)
self._datasource = datasource
Expand All @@ -30,7 +30,7 @@ async def request(
)


class StarknetpyClient(FullNodeClient): # type: ignore[misc]
class StarknetpyClient(FullNodeClient):
def __init__(
self,
datasource: Datasource[Any],
Expand Down
4 changes: 2 additions & 2 deletions src/dipdup/datasources/starknet_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dipdup.datasources import IndexDatasource

if TYPE_CHECKING:
from starknet_py.net.client_models import EventsChunk # type: ignore[import-untyped]
from starknet_py.net.client_models import EventsChunk

from dipdup.datasources._starknetpy import StarknetpyClient

Expand Down Expand Up @@ -50,7 +50,7 @@ async def subscribe(self) -> None:
raise NotImplementedError('Realtime mode is not supported yet; remove `ws_url` from datasource config')

async def get_head_level(self) -> int:
return await self.starknetpy.get_block_number() # type: ignore[no-any-return]
return await self.starknetpy.get_block_number()

async def get_events(
self,
Expand Down
4 changes: 2 additions & 2 deletions src/dipdup/indexes/starknet_events/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from collections.abc import Iterable
from typing import Any

from starknet_py.serialization._context import DeserializationContext # type: ignore
from starknet_py.serialization.data_serializers._common import deserialize_to_dict # type: ignore
from starknet_py.serialization._context import DeserializationContext
from starknet_py.serialization.data_serializers._common import deserialize_to_dict

from dipdup.config.starknet_events import StarknetEventsHandlerConfig
from dipdup.models.starknet import StarknetEvent
Expand Down
2 changes: 1 addition & 1 deletion src/dipdup/models/starknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from dipdup.subscriptions import Subscription

if TYPE_CHECKING:
from starknet_py.net.client_models import EmittedEvent # type: ignore[import-untyped]
from starknet_py.net.client_models import EmittedEvent


@dataclass(frozen=True)
Expand Down
Loading