feat: support constants and map references in v2 schema fields#291
Draft
lcastillo-ledger wants to merge 1 commit intomainfrom
Draft
feat: support constants and map references in v2 schema fields#291lcastillo-ledger wants to merge 1 commit intomainfrom
lcastillo-ledger wants to merge 1 commit intomainfrom
Conversation
3 tasks
182f41c to
ca31709
Compare
d7694b3 to
a6a40e5
Compare
Align v2 linter with updated ERC-7730 schema that widens many fields to accept constant references ($.metadata.constants.*) and map references alongside literal values. - Add InputMapReference model and update Pydantic input models for display, context and metadata fields (token, callee, selector, label, owner, etc.) - Thread strict_maps flag through the resolution pipeline: lint mode validates map references but drops them for resolution, calldata/convert modes error - Validate map references: check map path exists in metadata.maps, check keyPath is a valid container/data/descriptor path - Reject structured data paths (#.) in keyPath for context/metadata sections - Add @.chainId to container path grammar per spec - Handle empty resolved params dict after map reference drop Made-with: Cursor
a6a40e5 to
06bcd36
Compare
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.
Summary
$.metadata.constants.*) and map references alongside literal valuesInputMapReferencePydantic model and update all relevant v2 input models (display, context, metadata) to accept map references in their type unionsstrict_mapsflag through the resolution pipeline:lintmode validates map references but drops them for resolution;calldata/convertmodes produce errors since map resolution at conversion time is not yet supportedmetadata.maps, checkkeyPathis a valid container/data/descriptor path#.) inkeyPathfor context/metadata sections (where they have no meaning)@.chainIdto the container path grammar per ERC-7730 specTest plan
example-maps.jsonfrom ERC repo — lints cleanly$.metadata.maps.nonExistentMap) — correctly flagged@.foobar) — correctly flagged at parse time#.someField) — correctly rejectedMade with Cursor