Skip to content

Commit

Permalink
Add missing config docstrings, bump deps and testnet, update demo_eve…
Browse files Browse the repository at this point in the history
…nts (#600)
  • Loading branch information
droserasprout authored Jan 28, 2023
1 parent 0d065c8 commit d8fd819
Show file tree
Hide file tree
Showing 92 changed files with 494 additions and 698 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

### Fixed

- config: Do not include coinbase datasource credentials in config repr.
- database: Fixed crash when schema generation should fail with `schema_modified`.
- hasura: Stop using deprecated schema/metadata API.
- index: Fixed unnecessary prefetching of migration originations in `operation` index.
- index: Remove disabled index from the dispatcher queue.
- index: Remove disabled indexes from the dispatcher queue.
- sentry: Flush and reopen session daily.
- tzkt: Fixed `OperationData.type` field value for migration originations.
- tzkt: Added missing `last_level` argument to migration origination fetching methods.

### Other

- ci: Enforce markdownlint for docs.
- tzkt: Updated current testnet protocol (`limanet`).
- deps: Updated asyncpg to 0.27.0
- deps: Updated hasura to 2.17.0

Expand Down
64 changes: 11 additions & 53 deletions demos/demo-events/dipdup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,22 @@ database:
datasources:
tzkt:
kind: tzkt
url: https://api.kathmandunet.tzkt.io
url: https://api.ghostnet.tzkt.io

contracts:
events:
address: KT1F3Ai1GV6HXA7mzV8BZiPS9NEtDrRn9odn
events_null:
address: KT1F6nCM9Ks3aDT3FiSakQhCEbwGX3G91LjH
events_tzconst:
address: KT1Jw6Y8AJ1a4EeTN5XFeW6fmEgJsVnCHGAt
events_no_payload:
address: KT1KUnmrfPMPcwsiNTHHm4Y2ufNuExW3m7Y5
events_contract:
code_hash: KT1Up6AMehze2VTdt3w85xaZPtrEWn1AeyR3

indexes:
events:
kind: event
datasource: tzkt
handlers:
- callback: on_events_xrate
contract: events
tag: xrate
- callback: on_events_unknown
contract: events

events_null:
kind: event
datasource: tzkt
handlers:
- callback: on_events_null_null
contract: events_null
tag: "null"
- callback: on_events_null_none
contract: events_null
tag: "None"
- callback: on_events_null_unknown
contract: events_null

events_tzconst:
kind: event
datasource: tzkt
handlers:
- callback: on_events_tzconst_unit
contract: events_tzconst
tag: unit
- callback: on_events_tzconst_option
contract: events_tzconst
tag: option
- callback: on_events_tzconst_unknown
contract: events_tzconst

events_no_payload:
kind: event
datasource: tzkt
handlers:
- callback: on_events_no_payload_unit
contract: events_no_payload
tag: unit
- callback: on_events_no_payload_option
contract: events_no_payload
tag: option
- callback: on_events_no_payload_unknown
contract: events_no_payload
- callback: on_move_event
contract: events_contract
tag: move
- callback: on_roll_event
contract: events_contract
tag: roll
- callback: on_other_event
contract: events_contract

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions demos/demo-events/src/demo_events/handlers/on_events_null_none.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from demo_events import models as models
from demo_events.types.events.event.xrate import XratePayload
from demo_events.types.events_contract.event.move import MovePayload
from dipdup.context import HandlerContext
from dipdup.models import Event


async def on_events_xrate(
async def on_move_event(
ctx: HandlerContext,
event: Event[XratePayload],
event: Event[MovePayload],
) -> None:
...
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dipdup.models import UnknownEvent


async def on_events_unknown(
async def on_other_event(
ctx: HandlerContext,
event: UnknownEvent,
) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from demo_events import models as models
from demo_events.types.events_null.event.null import NullPayload
from demo_events.types.events_contract.event.roll import RollPayload
from dipdup.context import HandlerContext
from dipdup.models import Event


async def on_events_null_null(
async def on_roll_event(
ctx: HandlerContext,
event: Event[NullPayload],
event: Event[RollPayload],
) -> None:
...
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# generated by datamodel-codegen:
# filename: xrate.json
# filename: move.json

from __future__ import annotations

from pydantic import BaseModel
from pydantic import Extra


class XratePayload(BaseModel):
class MovePayload(BaseModel):
class Config:
extra = Extra.forbid

evxtz: str
xtz: str
address: str
a: str
b: str
roll: str
epoch: str
rolls: str
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# generated by datamodel-codegen:
# filename: unit.json
# filename: roll.json

from __future__ import annotations

from pydantic import BaseModel
from pydantic import Extra


class UnitPayload(BaseModel):
pass

class RollPayload(BaseModel):
class Config:
extra = Extra.forbid

address: str
bool: bool
Empty file.
Empty file.

This file was deleted.

Empty file.
Empty file.
10 changes: 0 additions & 10 deletions demos/demo-events/src/demo_events/types/events_null/event/none.py

This file was deleted.

10 changes: 0 additions & 10 deletions demos/demo-events/src/demo_events/types/events_null/event/null.py

This file was deleted.

Empty file.
Empty file.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
echo '<!-- markdownlint-disable first-line-h1 no-space-in-emphasis -->' > config/reference.md
echo '<!-- markdownlint-disable first-line-h1 -->' > include/context-reference.md
tail -n '+32' _build/html/cli-reference.html | head -n '-63' >> cli-reference.md
tail -n '+32' _build/html/config-reference.html | head -n '-63' >> config/reference.md
tail -n '+32' _build/html/config-reference.html | head -n '-63' | sed "s/dipdup.config.//g" | sed "s/dipdup.enums.//g" >> config/reference.md
tail -n '+32' _build/html/context-reference.html | head -n '-63' >> include/context-reference.md

mdbook build --dest-dir=dist/docs
Expand All @@ -23,7 +23,7 @@ lint: markdownlint orphans

serve:
make clean build
mdbook serve -o
mdbook serve

wc:
find . -name \*.md -type f -exec wc {} \;
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This page contains tips that may help to increase indexing speed.

[Postgres indexes](https://www.postgresql.org/docs/9.5/indexes-types.html) are tables that Postgres can use to speed up data lookup. A database index acts like a pointer to data in a table, just like an index in a printed book. If you look in the index first, you will find the data much quicker than searching the whole book (or — in this case — database).

You should add indexes on columns often appearing in `WHERE`` clauses in your GraphQL queries and subscriptions.
You should add indexes on columns often appearing in `WHERE` clauses in your GraphQL queries and subscriptions.

Tortoise ORM uses BTree indexes by default. To set index on a field, add `index=True` to the field definition:

Expand Down
1 change: 0 additions & 1 deletion docs/config-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
.. autoclass:: dipdup.enums.OperationType
:members:
:undoc-members:
.. autoclass:: dipdup.config.OperationUnfilteredHandlerConfig
.. autoclass:: dipdup.config.OperationUnfilteredIndexConfig
.. autoclass:: dipdup.config.PostgresDatabaseConfig
.. autoclass:: dipdup.config.PrometheusConfig
Expand Down
2 changes: 1 addition & 1 deletion docs/config/datasources.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ datasources:
metadata:
kind: metadata
url: https://metadata.dipdup.net
network: mainnet|ghostnet|jakartanet|kathmandunet
network: mainnet|ghostnet|limanet
```
## ipfs
Expand Down
Loading

0 comments on commit d8fd819

Please sign in to comment.