Skip to content

fix(EIP-712): PropDef::parse supports extra whitespaces - #1102

Merged
DaniPopes merged 1 commit into
alloy-rs:mainfrom
anaPerezGhiglia:fix/eip712-parse-tolerates-whitespaces
May 23, 2026
Merged

DaniPopes merged 1 commit into
alloy-rs:mainfrom
anaPerezGhiglia:fix/eip712-parse-tolerates-whitespaces

Conversation

@anaPerezGhiglia

Copy link
Copy Markdown
Contributor

Motivation

Current implementation fails to parse EIP-712 types containing certain whitespace: specifically, whitespace immediately before a ) or ,. Leading whitespace after ( and after , are already tolerated.

The root cause is PropDef::parse relying on rsplit_once(' ') without trimming its input first. As a result, in the cases mentioned above, the split leaves an internal space inside the type half that TypeSpecifier::parse_eip712 then rejects.

Solution

Trim PropDef::parse input parameter before splitting and parsing it.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@anaPerezGhiglia anaPerezGhiglia changed the title fix(eip712): PropDef::parse supports extra whitespaces fix(EIP-712): PropDef::parse supports extra whitespaces May 13, 2026

@DaniPopes DaniPopes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-project-automation github-project-automation Bot moved this to Reviewed in Alloy May 23, 2026
@DaniPopes
DaniPopes enabled auto-merge (squash) May 23, 2026 14:40
@DaniPopes
DaniPopes merged commit aedc8b8 into alloy-rs:main May 23, 2026
31 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants