Commit a038aa8
authored
fix(dyn-abi): coerce JSON int values above i64::MAX for signed types (#1158)
eip712 coerce_json read signed integers only through serde_json's as_i64,
while the sibling uint path uses as_u64. serde_json stores any integer in
(i64::MAX, u64::MAX] as a u64, so a valid positive value for int72..int256
(e.g. 2^63 into int128) returned None and coerce_json failed, even though
the same value is accepted as a JSON string and accepted by uint as a number.
Add a u64 fallback mirroring uint, plus a regression test.1 parent a5df2f9 commit a038aa8
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
205 | 219 | | |
206 | 220 | | |
207 | 221 | | |
| |||
0 commit comments