Skip to content

Commit

Permalink
fix sqd args casing
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Jan 15, 2025
1 parent be5fe9e commit 254ee0d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dipdup/runtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 254ee0d

Please sign in to comment.