Compare mustMatch/ifNotIn values numerically and keep hidden bundle slots - #13
Open
manuelwedler wants to merge 1 commit into
Open
Conversation
…lots - Decimal strings and JSON numbers in visible.mustMatch / visible.ifNotIn now compare as integers against decoded calldata words and EIP-712 message values. Signed ints compare as two's complement. - Hex literals compare case-insensitively so checksummed addresses match lowercase decoded addresses. - Hidden array elements inside a group keep an empty bundle slot, so bundled groups with mustMatch or never fields no longer fail the equal-length check in both the calldata and EIP-712 engines. Ref: ethereum/clear-signing-erc7730-registry#2598
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
Fixes problems 2 and 3 from ethereum/clear-signing-erc7730-registry#2598 (see this comment).
mustMatch/ifNotIncomparison. Decimal strings and JSON numbers in the descriptor now compare as integers against decoded calldata words and EIP-712 message values. Signedintarguments compare as two's complement, so"-1"works. Hex literals compare case-insensitively, so checksummed addresses match lowercase decoded addresses. Full hex words used by existing descriptors still match as before.bundledgroups. A hidden array element now keeps an empty bundle slot instead of being dropped. Bundled groups that containmustMatchorneverfields no longer fail the equal-length check. Applied to both the calldata and EIP-712 engines.Tests
Six new spec compliance tests:
mustMatchwith decimal strings and a checksummed address, plus the mismatch error pathifNotInwith a JSON numbermustMatchonint256with"-1"and with a full hex wordmustMatchwith a JSON number, a short hex literal, and a checksummed addressmustMatchfield and aneverfieldcargo testpasses (443 tests),cargo fmt --checkis clean, UniFFI feature build compiles. Clippy is clean for the library and spec test target. A pre-existing clippy error insafe_integration.rsonmainis unrelated and untouched.