Validates a batch of predicates submitted at ingress. Rejects an empty batch, a batch larger than `max`, and any predicate whose parameters are internally inconsistent.
(predicates: &[Self], max: usize)
| 301 | /// Rejects an empty batch, a batch larger than `max`, and any predicate |
| 302 | /// whose parameters are internally inconsistent. |
| 303 | pub fn validate_batch(predicates: &[Self], max: usize) -> Result<(), ValidityPredicateError> { |
| 304 | if predicates.is_empty() { |
| 305 | return Err(ValidityPredicateError::Empty); |
| 306 | } |
| 307 | if predicates.len() > max { |
| 308 | return Err(ValidityPredicateError::TooMany { count: predicates.len(), max }); |
| 309 | } |
| 310 | for (index, predicate) in predicates.iter().enumerate() { |
| 311 | predicate.validate_params(index)?; |
| 312 | } |
| 313 | Ok(()) |
| 314 | } |
| 315 | |
| 316 | /// Validates that a batch contains a `block_number` upper-bound predicate. |
| 317 | /// |
nothing calls this directly
no test coverage detected