From 254ee0d8450d951b619d327ae4e97d3bd6905098 Mon Sep 17 00:00:00 2001 From: Lev Gorodetskiy Date: Wed, 15 Jan 2025 01:44:55 -0300 Subject: [PATCH] fix sqd args casing --- src/dipdup/runtimes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dipdup/runtimes.py b/src/dipdup/runtimes.py index e99983e3d..3c38b8f2e 100644 --- a/src/dipdup/runtimes.py +++ b/src/dipdup/runtimes.py @@ -12,6 +12,7 @@ from dipdup.config.substrate import SubstrateRuntimeConfig from dipdup.exceptions import FrameworkException from dipdup.package import DipDupPackage +from dipdup.utils import pascal_to_snake from dipdup.utils import sorted_glob if TYPE_CHECKING: @@ -190,9 +191,16 @@ def decode_event_args( metadata=spec_obj._metadata, ) + # NOTE: Exception is raised after decoding is over with suppress(RemainingScaleBytesNotEmptyException): scale_obj.decode(check_remaining=False) payload[key] = scale_obj.value_serialized + # FIXME: Subsquid camelcases arg keys for some reason + for key in payload: + if key not in arg_names: + new_key = pascal_to_snake(key) + payload[new_key] = payload.pop(key) + return payload