diff --git a/docs/8.examples/_demos_table.md b/docs/8.examples/_demos_table.md index 80f8858fc..7451fd066 100644 --- a/docs/8.examples/_demos_table.md +++ b/docs/8.examples/_demos_table.md @@ -2,7 +2,7 @@ | name | network | description | source | |-|-|-|-| | demo_blank | | Empty config for a fresh start | [link](https://github.com/dipdup-io/dipdup/tree/8.1.2/src/demo_blank) | -| demo_substrate_events | | Substrate balance transfers [PREVIEW] | [link](https://github.com/dipdup-io/dipdup/tree/8.1.2/src/demo_substrate_events) | +| demo_substrate_events | | Substrate balance transfers | [link](https://github.com/dipdup-io/dipdup/tree/8.1.2/src/demo_substrate_events) | | demo_evm_events | EVM | ERC-20 token transfers (from event logs) | [link](https://github.com/dipdup-io/dipdup/tree/8.1.2/src/demo_evm_events) | | demo_evm_transactions | EVM | ERC-20 token transfers (from transactions) | [link](https://github.com/dipdup-io/dipdup/tree/8.1.2/src/demo_evm_transactions) | | demo_evm_uniswap | EVM | Uniswap V3 pools, positions, etc. (advanced, uses TimescaleDB) | [link](https://github.com/dipdup-io/dipdup/tree/8.1.2/src/demo_evm_uniswap) | diff --git a/src/demo_substrate_events/README.md b/src/demo_substrate_events/README.md index f416ecaff..f6b252c38 100644 --- a/src/demo_substrate_events/README.md +++ b/src/demo_substrate_events/README.md @@ -1,6 +1,6 @@ # demo_substrate_events -Substrate balance transfers [PREVIEW] +Substrate balance transfers ## Installation diff --git a/src/demo_substrate_events/configs/replay.yaml b/src/demo_substrate_events/configs/replay.yaml index 51a4937cd..ef6696c65 100644 --- a/src/demo_substrate_events/configs/replay.yaml +++ b/src/demo_substrate_events/configs/replay.yaml @@ -7,7 +7,7 @@ replay: template: demo_substrate_events package: demo_substrate_events version: 0.0.1 - description: Substrate balance transfers [PREVIEW] + description: Substrate balance transfers license: MIT name: John Doe email: john_doe@example.com diff --git a/src/demo_substrate_events/deploy/Dockerfile b/src/demo_substrate_events/deploy/Dockerfile index 4c134a235..10dbd737f 100644 --- a/src/demo_substrate_events/deploy/Dockerfile +++ b/src/demo_substrate_events/deploy/Dockerfile @@ -1,7 +1,6 @@ -# FROM dipdup/dipdup:8 +FROM dipdup/dipdup:8 # FROM ghcr.io/dipdup-io/dipdup:8 -# FIXME: substrate preview -FROM ghcr.io/dipdup-io/dipdup:feat-substrate +# FROM ghcr.io/dipdup-io/dipdup:next # COPY --chown=dipdup pyproject.toml README.md . # RUN pip install . diff --git a/src/demo_substrate_events/dipdup.yaml b/src/demo_substrate_events/dipdup.yaml index b125f1c36..33995680c 100644 --- a/src/demo_substrate_events/dipdup.yaml +++ b/src/demo_substrate_events/dipdup.yaml @@ -28,4 +28,4 @@ indexes: - node handlers: - callback: on_transfer - name: Assets.Transferred + name: Assets.Transferred \ No newline at end of file diff --git a/src/demo_substrate_events/pyproject.toml b/src/demo_substrate_events/pyproject.toml index 93152ffaf..69e8fd163 100644 --- a/src/demo_substrate_events/pyproject.toml +++ b/src/demo_substrate_events/pyproject.toml @@ -1,8 +1,8 @@ -# generated by DipDup 8.1.1 +# generated by DipDup 8.1.2 [project] name = "demo_substrate_events" version = "0.0.1" -description = "Substrate balance transfers [PREVIEW]" +description = "Substrate balance transfers" license = { text = "MIT" } authors = [ { name = "John Doe", email = "john_doe@example.com" }, diff --git a/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v601.py b/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v601.py index b795bf79c..afcbb6380 100644 --- a/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v601.py +++ b/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v601.py @@ -1,4 +1,4 @@ -# generated by DipDup 8.1.1 +# generated by DipDup 8.1.2 from __future__ import annotations diff --git a/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v700.py b/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v700.py index f66c00ec6..7f84fa9a8 100644 --- a/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v700.py +++ b/src/demo_substrate_events/types/assethub/substrate_events/assets_transferred/v700.py @@ -1,4 +1,4 @@ -# generated by DipDup 8.1.1 +# generated by DipDup 8.1.2 from __future__ import annotations diff --git a/src/dipdup/codegen/substrate.py b/src/dipdup/codegen/substrate.py index db597c710..4cd53a4ad 100644 --- a/src/dipdup/codegen/substrate.py +++ b/src/dipdup/codegen/substrate.py @@ -13,6 +13,7 @@ from dipdup.config.substrate_events import SubstrateEventsIndexConfig from dipdup.config.substrate_subscan import SubstrateSubscanDatasourceConfig from dipdup.datasources import Datasource +from dipdup.datasources.substrate_node import SubstrateNodeDatasource from dipdup.datasources.substrate_subscan import SubstrateSubscanDatasource from dipdup.package import DipDupPackage from dipdup.runtimes import SubstrateRuntime @@ -251,5 +252,8 @@ def _get_runtime(self, name: str) -> SubstrateRuntime: self._runtimes[name] = SubstrateRuntime( config=self._config.runtimes[name], package=self._package, + interface=next( + d for d in self._datasources.values() if isinstance(d, SubstrateNodeDatasource) + )._interface, ) return self._runtimes[name] diff --git a/src/dipdup/fields.py b/src/dipdup/fields.py index 429d02858..ef9403ca1 100644 --- a/src/dipdup/fields.py +++ b/src/dipdup/fields.py @@ -46,7 +46,7 @@ from tortoise.fields.relational import ReverseRelation as ReverseRelation from dipdup.exceptions import FrameworkException -from dipdup.utils import json_dumps +from dipdup.utils import json_dumps_plain if TYPE_CHECKING: from tortoise.models import Model as _TortoiseModel @@ -58,10 +58,9 @@ _EnumFieldT = TypeVar('_EnumFieldT', bound=Enum) -# TODO: changelog JSONField = partial( _JSONField, - encoder=partial(json_dumps, option=None), # type: ignore[arg-type] + encoder=json_dumps_plain, decoder=orjson.loads, ) diff --git a/src/dipdup/project.py b/src/dipdup/project.py index e0c7cb923..6fcb686b1 100644 --- a/src/dipdup/project.py +++ b/src/dipdup/project.py @@ -155,7 +155,7 @@ def template_from_terminal() -> tuple[str | None, DipDupSurveyConfig | None]: comments=( 'EVM-compatible blockchains', 'Starknet', - 'Substrate [PREVIEW]', + 'Substrate', 'Tezos', ), default=0, diff --git a/src/dipdup/projects/demo_substrate_events/deploy/Dockerfile.j2 b/src/dipdup/projects/demo_substrate_events/deploy/Dockerfile.j2 deleted file mode 100644 index e1c666465..000000000 --- a/src/dipdup/projects/demo_substrate_events/deploy/Dockerfile.j2 +++ /dev/null @@ -1,10 +0,0 @@ -# FROM dipdup/dipdup:8 -# FROM ghcr.io/dipdup-io/dipdup:8 -# FIXME: substrate preview -FROM ghcr.io/dipdup-io/dipdup:feat-substrate - -# COPY --chown=dipdup pyproject.toml README.md . -# RUN pip install . - -COPY --chown=dipdup . {{ project.package }} -WORKDIR {{ project.package }} \ No newline at end of file diff --git a/src/dipdup/projects/demo_substrate_events/replay.yaml b/src/dipdup/projects/demo_substrate_events/replay.yaml index 8a79c588a..9da225d39 100644 --- a/src/dipdup/projects/demo_substrate_events/replay.yaml +++ b/src/dipdup/projects/demo_substrate_events/replay.yaml @@ -1,5 +1,5 @@ spec_version: 3.0 replay: - description: Substrate balance transfers [PREVIEW] + description: Substrate balance transfers package: demo_substrate_events template: demo_substrate_events \ No newline at end of file diff --git a/src/dipdup/runtimes.py b/src/dipdup/runtimes.py index 1ba1215fb..a9f366eb8 100644 --- a/src/dipdup/runtimes.py +++ b/src/dipdup/runtimes.py @@ -102,7 +102,7 @@ def runtime_config(self) -> 'RuntimeConfigurationObject': from scalecodec.base import RuntimeConfigurationObject # FIXME: Generic configuration for cases when node datasources are not available - runtime_config = RuntimeConfigurationObject(ss58_format=99) + runtime_config = RuntimeConfigurationObject() runtime_config.update_type_registry(get_type_registry('legacy')) runtime_config.update_type_registry(get_type_registry('core')) runtime_config.update_type_registry(get_type_registry(self._config.type_registry or self._config.name))