Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Dec 16, 2024
1 parent e0817cd commit 4cb6fd0
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/8.examples/_demos_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
2 changes: 1 addition & 1 deletion src/demo_substrate_events/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# demo_substrate_events

Substrate balance transfers [PREVIEW]
Substrate balance transfers

## Installation

Expand Down
2 changes: 1 addition & 1 deletion src/demo_substrate_events/configs/replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
Expand Down
5 changes: 2 additions & 3 deletions src/demo_substrate_events/deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Expand Down
2 changes: 1 addition & 1 deletion src/demo_substrate_events/dipdup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ indexes:
- node
handlers:
- callback: on_transfer
name: Assets.Transferred
name: Assets.Transferred
4 changes: 2 additions & 2 deletions src/demo_substrate_events/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# generated by DipDup 8.1.1
# generated by DipDup 8.1.2

from __future__ import annotations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# generated by DipDup 8.1.1
# generated by DipDup 8.1.2

from __future__ import annotations

Expand Down
4 changes: 4 additions & 0 deletions src/dipdup/codegen/substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
5 changes: 2 additions & 3 deletions src/dipdup/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
)

Expand Down
2 changes: 1 addition & 1 deletion src/dipdup/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def template_from_terminal() -> tuple[str | None, DipDupSurveyConfig | None]:
comments=(
'EVM-compatible blockchains',
'Starknet',
'Substrate [PREVIEW]',
'Substrate',
'Tezos',
),
default=0,
Expand Down
10 changes: 0 additions & 10 deletions src/dipdup/projects/demo_substrate_events/deploy/Dockerfile.j2

This file was deleted.

2 changes: 1 addition & 1 deletion src/dipdup/projects/demo_substrate_events/replay.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/dipdup/runtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4cb6fd0

Please sign in to comment.