Skip to content

fix: byte and uintDecimal patterns fixed to match geth#802

Open
felix314159 wants to merge 1 commit into
ethereum:mainfrom
felix314159:fix-base-types
Open

fix: byte and uintDecimal patterns fixed to match geth#802
felix314159 wants to merge 1 commit into
ethereum:mainfrom
felix314159:fix-base-types

Conversation

@felix314159
Copy link
Copy Markdown

two regex patterns in src/schemas/base-types.yaml diverge from what geth actually does:

  • byte
- ^0x([0-9a-fA-F]?){1,2}$
+ ^0x[0-9a-f]{1,2}$

Old pattern allows "0x" but geth would always append at least one hex digit (e.g. to make it 0x0 in the smallest case)


  • uintDecimal
- ^[1-9][0-9]*$
+ ^(0|[1-9][0-9]*)$

old pattern rejects "0" but geth allows plain 0 (here api.networkVersion is just uint64 and there is no guarding or whatever against 0). i used this example cuz it is the JSON-emitter for net_version


AFAIK all in-spec example values that resolve to these two types still validate without additional changes

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