diff --git a/src/demo_substrate_events/handlers/on_transfer.py b/src/demo_substrate_events/handlers/on_transfer.py index cf1d39664..9a301c88d 100644 --- a/src/demo_substrate_events/handlers/on_transfer.py +++ b/src/demo_substrate_events/handlers/on_transfer.py @@ -21,6 +21,7 @@ async def sql_update( ) +# NOTE: Not used, just for demonstration purposes async def orm_update( ctx: HandlerContext, address: str, @@ -47,9 +48,5 @@ async def on_transfer( if not amount: return - if ctx.is_finalized: - await sql_update(ctx, event.payload['from'], -amount, event.data.level) - await sql_update(ctx, event.payload['to'], amount, event.data.level) - else: - await orm_update(ctx, event.payload['from'], -amount, event.data.level) - await orm_update(ctx, event.payload['to'], amount, event.data.level) + await sql_update(ctx, event.payload['from'], -amount, event.data.level) + await sql_update(ctx, event.payload['to'], amount, event.data.level) diff --git a/src/dipdup/projects/demo_substrate_events/handlers/on_transfer.py.j2 b/src/dipdup/projects/demo_substrate_events/handlers/on_transfer.py.j2 index 59be86595..86a15ed58 100644 --- a/src/dipdup/projects/demo_substrate_events/handlers/on_transfer.py.j2 +++ b/src/dipdup/projects/demo_substrate_events/handlers/on_transfer.py.j2 @@ -21,6 +21,7 @@ async def sql_update( ) +# NOTE: Not used, just for demonstration purposes async def orm_update( ctx: HandlerContext, address: str, @@ -47,9 +48,5 @@ async def on_transfer( if not amount: return - if ctx.is_finalized: - await sql_update(ctx, event.payload['from'], -amount, event.data.level) - await sql_update(ctx, event.payload['to'], amount, event.data.level) - else: - await orm_update(ctx, event.payload['from'], -amount, event.data.level) - await orm_update(ctx, event.payload['to'], amount, event.data.level) + await sql_update(ctx, event.payload['from'], -amount, event.data.level) + await sql_update(ctx, event.payload['to'], amount, event.data.level)