Skip to content

Commit 53ba0bf

Browse files
committed
Add minimum constraint for integer types in API JSON files
1 parent 0034c43 commit 53ba0bf

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

api/starknet_api_openrpc.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,7 +3287,8 @@
32873287
"function_idx": {
32883288
"title": "Function index",
32893289
"description": "The index of the function in the program",
3290-
"type": "integer"
3290+
"type": "integer",
3291+
"minimum": 0
32913292
}
32923293
},
32933294
"required": ["selector", "function_idx"]
@@ -3373,7 +3374,8 @@
33733374
"offset": {
33743375
"title": "Offset",
33753376
"description": "offset of this property within the struct",
3376-
"type": "integer"
3377+
"type": "integer",
3378+
"minimum": 0
33773379
}
33783380
}
33793381
}
@@ -3616,17 +3618,20 @@
36163618
"l1_gas": {
36173619
"title": "L1Gas",
36183620
"description": "l1 gas consumed by this transaction, used for l2-->l1 messages and state updates if blobs are not used",
3619-
"type": "integer"
3621+
"type": "integer",
3622+
"minimum": 0
36203623
},
36213624
"l1_data_gas": {
36223625
"title": "L1DataGas",
36233626
"description": "data gas consumed by this transaction, 0 if blobs are not used",
3624-
"type": "integer"
3627+
"type": "integer",
3628+
"minimum": 0
36253629
},
36263630
"l2_gas": {
36273631
"title": "L2Gas",
36283632
"description": "l2 gas consumed by this transaction, used for computation and calldata",
3629-
"type": "integer"
3633+
"type": "integer",
3634+
"minimum": 0
36303635
}
36313636
},
36323637
"required": ["l1_gas", "l1_data_gas", "l2_gas"]
@@ -3668,7 +3673,8 @@
36683673
},
36693674
"length": {
36703675
"description": "the length of the path (bounded by 251)",
3671-
"type": "integer"
3676+
"type": "integer",
3677+
"minimum": 0
36723678
},
36733679
"child": {
36743680
"description": "the hash of the unique non-zero maximal-height descendant node",
@@ -3799,7 +3805,8 @@
37993805
"transaction_index": {
38003806
"title": "Transaction index",
38013807
"description": "The index of the first transaction failing in a sequence of given transactions",
3802-
"type": "integer"
3808+
"type": "integer",
3809+
"minimum": 0
38033810
},
38043811
"execution_error": {
38053812
"title": "revert error",

api/starknet_executables.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
"items": {
9494
"oneOf": [
9595
{
96-
"type": "integer"
96+
"type": "integer",
97+
"minimum": 0
9798
},
9899
{
99100
"type": "array",
@@ -111,7 +112,8 @@
111112
"type": "array",
112113
"description": "a list of sizes of segments in the bytecode, each segment is hashed individually when computing the bytecode hash",
113114
"items": {
114-
"type": "integer"
115+
"type": "integer",
116+
"minimum": 0
115117
}
116118
}
117119
},
@@ -129,7 +131,8 @@
129131
"offset": {
130132
"title": "Offset",
131133
"description": "The offset of the entry point in the program",
132-
"type": "integer"
134+
"type": "integer",
135+
"minimum": 0
133136
},
134137
"selector": {
135138
"title": "Selector",
@@ -154,7 +157,8 @@
154157
"enum": ["AP", "FP"]
155158
},
156159
"offset": {
157-
"type": "integer"
160+
"type": "integer",
161+
"minimum": 0
158162
}
159163
},
160164
"required": ["register", "offset"]
@@ -182,7 +186,8 @@
182186
"$ref": "#/components/schemas/CellRef"
183187
},
184188
{
185-
"type": "integer"
189+
"type": "integer",
190+
"minimum": 0
186191
}
187192
]
188193
},

api/starknet_trace_api_openrpc.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@
401401
"order": {
402402
"title": "order",
403403
"description": "the order of the event within the transaction",
404-
"type": "integer"
404+
"type": "integer",
405+
"minimum": 0
405406
}
406407
}
407408
},
@@ -421,7 +422,8 @@
421422
"order": {
422423
"title": "order",
423424
"description": "the order of the message within the transaction",
424-
"type": "integer"
425+
"type": "integer",
426+
"minimum": 0
425427
}
426428
}
427429
},
@@ -438,12 +440,14 @@
438440
"l1_gas": {
439441
"title": "L1Gas",
440442
"description": "l1 gas consumed by this transaction, used for l2-->l1 messages and state updates if blobs are not used",
441-
"type": "integer"
443+
"type": "integer",
444+
"minimum": 0
442445
},
443446
"l2_gas": {
444447
"title": "L2Gas",
445448
"description": "l2 gas consumed by this transaction, used for computation and calldata",
446-
"type": "integer"
449+
"type": "integer",
450+
"minimum": 0
447451
}
448452
},
449453
"required": ["l1_gas", "l2_gas"]

0 commit comments

Comments
 (0)