Skip to content

fix(transactions): preserve decoded calldata Map in simplified receipts - #221

Open
bars26 wants to merge 1 commit into
genlayerlabs:v2-devfrom
bars26:fix-receipt-map-simplification
Open

bars26 wants to merge 1 commit into
genlayerlabs:v2-devfrom
bars26:fix-receipt-map-simplification

Conversation

@bars26

@bars26 bars26 commented Sep 14, 2026 •

Copy link
Copy Markdown

Closes #219

Summary

simplifyTransactionReceipt's internal simplifyObject helper walks nested values with Object.entries(), but decoded calldata (txDataDecoded.callData / constructorArgs, per abi/calldata/decoder.ts's TYPE_MAP) is a Map<string, CalldataEncodable>, not a plain object. Object.entries() on a Map returns no entries, so the decoded method name and arguments were silently dropped from the default (simplified) receipt instead of only removing the raw presentation metadata this function is meant to strip.

Fix

Detect a Map before falling into the generic object branch, and convert it to a plain object so its entries go through the same simplification as everything else (recursively, same as arrays/objects).

Branch

Targeting v2-dev, not v1: the simplifyTransactionReceipt / calldata-Map code this bug lives in doesn't exist on v1 at all (checked — no simplif* files there), so there's nothing to fix on the stable branch.

Note on assignment

CONTRIBUTING.md asks contributors to self-assign the issue before starting — I don't have write access to do that as an outside contributor (gh issue edit --add-assignee @me fails with a permissions error), so I'm opening this directly. Happy to close and resubmit if you'd rather it go through a different flow.

Test plan

  • Added two regression tests reproducing the exact repro from the issue (a Map-shaped callData and a Map-shaped constructorArgs), both verified to fail with the old code (undefined instead of the decoded values) and pass with the fix
  • vitest run --typecheck: 195/195 tests pass, no type errors
  • eslint: clean on changed files

🤖 Generated with Claude Code

simplifyTransactionReceipt's simplifyObject helper used Object.entries
to walk nested objects, but decoded calldata (txDataDecoded.callData /
constructorArgs, per abi/calldata/decoder.ts's TYPE_MAP) is a
Map<string, CalldataEncodable>, not a plain object. Object.entries on
a Map returns no entries, so the decoded method name and arguments
were silently dropped from the default (simplified) receipt.

Converts a Map to a plain object before applying the same
simplification as everything else, instead of falling through the
generic object branch.

Closes genlayerlabs#219

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b02d902a-3847-4643-a44d-b24ae34e970d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant