Skip to content

Commit 28e82b4

Browse files
PelleKrabfjl
andauthored
fix incorrect regular expressions for uint base types (#605)
Closes #556 Note the slot parameter of eth_getStorageAt had to be relaxed to bytesMax32, since the new uint256 pattern disallows leading zero, but usage of leading zero is commonplace for storage slots. --------- Co-authored-by: Felix Lange <[email protected]>
1 parent 25a570c commit 28e82b4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/eth/state.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
- name: Storage slot
3434
required: true
3535
schema:
36-
$ref: '#/components/schemas/uint256'
36+
# this used to require strict uint256, but usage of leading zero is commonplace,
37+
# so we can't disallow it.
38+
$ref: '#/components/schemas/bytesMax32'
3739
- name: Block
3840
required: true
3941
schema:

src/schemas/base-types.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ ratio:
5151
uint:
5252
title: hex encoded unsigned integer
5353
type: string
54-
pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
54+
pattern: ^0x(0|[1-9a-f][0-9a-f]*)$
5555
uint64:
5656
title: hex encoded 64 bit unsigned integer
5757
type: string
58-
pattern: ^0x([1-9a-f]+[0-9a-f]{0,15})|0$
58+
pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$
5959
uint256:
6060
title: hex encoded 256 bit unsigned integer
6161
type: string
62-
pattern: ^0x([1-9a-f]+[0-9a-f]{0,31})|0$
62+
pattern: ^0x(0|[1-9a-f][0-9a-f]{0,63})$
6363
hash32:
6464
title: 32 byte hex value
6565
type: string

0 commit comments

Comments
 (0)