Conversation
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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #219
Summary
simplifyTransactionReceipt's internalsimplifyObjecthelper walks nested values withObject.entries(), but decoded calldata (txDataDecoded.callData/constructorArgs, perabi/calldata/decoder.ts'sTYPE_MAP) is aMap<string, CalldataEncodable>, not a plain object.Object.entries()on aMapreturns 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
Mapbefore 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, notv1: thesimplifyTransactionReceipt/ calldata-Mapcode this bug lives in doesn't exist onv1at all (checked — nosimplif*files there), so there's nothing to fix on the stable branch.Note on assignment
CONTRIBUTING.mdasks 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 @mefails 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
Map-shapedcallDataand aMap-shapedconstructorArgs), both verified to fail with the old code (undefinedinstead of the decoded values) and pass with the fixvitest run --typecheck: 195/195 tests pass, no type errorseslint: clean on changed files🤖 Generated with Claude Code