Skip to content

Commit b557ad5

Browse files
Update demo configs, fix schema export, check for early_realtime in big_map index (#212)
* Update demo configs, raise exception on useless combo * Bump * Fix schema export * Fix registrydao demo and test
1 parent e6fbf60 commit b557ad5

File tree

10 files changed

+224
-195
lines changed

10 files changed

+224
-195
lines changed

poetry.lock

Lines changed: 192 additions & 191 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/demo_hic_et_nunc/dipdup.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ datasources:
1818
kind: tzkt
1919
url: ${TZKT_URL:-https://api.tzkt.io}
2020

21+
advanced:
22+
early_realtime: True
23+
2124
indexes:
2225
hen_mainnet:
2326
kind: operation

src/demo_quipuswap/dipdup.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ datasources:
2424
kind: tzkt
2525
url: https://api.tzkt.io
2626

27+
advanced:
28+
early_realtime: True
29+
2730
templates:
2831
quipuswap_fa12:
2932
kind: operation

src/demo_registrydao/dipdup.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ database:
77

88
contracts:
99
registry:
10-
address: KT1JytEHBVBg27n9w85tNhSWUpbTvETD6rx6
10+
address: KT19CF3KKrvdW77ttFomCuin2k4uAVkryYqh
1111
typename: registry
1212

1313
datasources:
1414
tzkt:
1515
kind: tzkt
1616
url: ${TZKT_URL:-https://api.tzkt.io}
1717

18+
advanced:
19+
early_realtime: True
20+
1821
templates:
1922

2023
registry_dao:

src/demo_tezos_domains/dipdup.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ datasources:
1515
kind: tzkt
1616
url: ${TZKT_URL:-https://api.tzkt.io}
1717

18+
advanced:
19+
early_realtime: True
20+
1821
templates:
1922
tezos_domains:
2023
kind: operation

src/demo_tzbtc/dipdup.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ datasources:
1515
kind: tzkt
1616
url: https://api.tzkt.io
1717

18+
advanced:
19+
early_realtime: True
20+
1821
indexes:
1922
tzbtc_holders_mainnet:
2023
kind: operation

src/demo_tzcolors/dipdup.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ datasources:
1818
kind: tzkt
1919
url: ${TZKT_URL:-https://api.tzkt.io}
2020

21+
advanced:
22+
early_realtime: True
23+
2124
templates:
2225

2326
tzcolors_auction:

src/dipdup/cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ async def schema_export(ctx):
427427
async with tortoise_wrapper(url, models):
428428
conn = get_connection(None)
429429
output = get_schema_sql(conn, False) + '\n'
430-
for file in iter_files(join(config.package_path, 'sql', 'on_reindex')):
431-
output += file.read() + '\n'
430+
dipdup_sql_path = join(dirname(__file__), 'sql', 'on_reindex')
431+
project_sql_path = join(config.package_path, 'sql', 'on_reindex')
432+
433+
for sql_path in (dipdup_sql_path, project_sql_path):
434+
for file in iter_files(sql_path):
435+
output += file.read() + '\n'
436+
432437
echo(output)

src/dipdup/index.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from dipdup.datasources.tzkt.datasource import TzktDatasource
4141
from dipdup.datasources.tzkt.models import deserialize_storage
4242
from dipdup.exceptions import ConfigInitializationException
43+
from dipdup.exceptions import ConfigurationError
4344
from dipdup.exceptions import InvalidDataError
4445
from dipdup.exceptions import ReindexingReason
4546
from dipdup.models import BigMapAction
@@ -608,6 +609,10 @@ async def _synchronize_full(self, first_level: int, last_level: int, cache: bool
608609
await self._process_level_big_maps(big_maps)
609610

610611
async def _synchronize_level(self, last_level: int, cache: bool = False) -> None:
612+
# NOTE: Checking late because feature flags could be modified after loading config
613+
if not self._ctx.config.advanced.early_realtime:
614+
raise ConfigurationError('`skip_history` requires `early_realtime` feature flag to be enabled')
615+
611616
big_map_addresses = await self._get_big_map_addresses()
612617
big_map_paths = await self._get_big_map_paths()
613618
big_map_ids: Tuple[Tuple[int, str], ...] = ()

tests/integration_tests/registrydao.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ database:
77

88
contracts:
99
registry:
10-
address: KT1QMdCTqzmY4QKHntV1nZEinLPU1GbxUFQu
10+
address: KT19CF3KKrvdW77ttFomCuin2k4uAVkryYqh
1111
typename: registry
1212

1313
datasources:

0 commit comments

Comments
 (0)