Commit 1f81ff0
fix 2d array bug of abiSchemaToJsonSchema in web3-validator (web3#6836)
* fix 2d array bug of abiSchemaToJsonSchema in web3-validator
* fix 2d array bug of abiSchemaToJsonSchema in web3-validator(add comments)
* fix abi json schema test case:
- 123 cannot be uint
- test case("nested tuple object in nested array") has a wrong data structure of tuple[][3]
* fix function abiSchemaToJsonSchema in iterating over arraySizes array to each dimension
* FIX:
1. fix function convertToZod to distinguish tuple and array, add checks in maxItems & minItems
2. revert abiSchemaToJsonSchema of utils and fix
3. add testcases in validator.validate
* UPDATE: contract test
---------
Co-authored-by: Yi Zhang <yi.y.zhang@maplequad.com>1 parent f943944 commit 1f81ff0
File tree
6 files changed
+504
-415
lines changed- packages
- web3-eth-contract/test/unit
- web3-validator
- src
- test
- fixtures
- unit
6 files changed
+504
-415
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
195 | | - | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
223 | 218 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
239 | 228 | | |
240 | 229 | | |
241 | 230 | | |
242 | 231 | | |
243 | 232 | | |
244 | | - | |
| 233 | + | |
245 | 234 | | |
246 | 235 | | |
247 | 236 | | |
| |||
505 | 494 | | |
506 | 495 | | |
507 | 496 | | |
508 | | - | |
| 497 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
0 commit comments