Repository navigation
Commit 4685a77
committed
test(rpc): cover BatchSizeLimitMiddleware with max_entries=0
The middleware's `max_entries = 0` corner case (allowed in-process
because `BatchSizeLimitMiddleware::new` has no guard, even though
the CLI value parser `parse_max_batch_entries` rejects 0) was
untested. Add a focused test that locks in the documented behaviour:
any non-empty batch is rejected with `BATCH_TOO_LARGE_ERROR_CODE`,
and the error message names the offending size and limit.
An empty-batch pass-through test was considered and dropped: the
`MockRpcService` itself rejects empty batches with a different
error code (-32600 'Invalid request'), and asserting on the
final response shape would lock in that quirk rather than the
middleware's contract. The empty-batch case is left to the
JSON-RPC layer below the middleware.1 parent a85368c commit 4685a77
1 file changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1182 | 1209 | | |
1183 | 1210 | | |
1184 | 1211 | | |
| |||
0 commit comments