reth_db_api/tables/codecs/fuzz/inputs.rs
1//! Curates the input coming from the fuzzer for certain types.
2
3use crate::models::IntegerList;
4use serde::{Deserialize, Serialize};
5
6/// Makes sure that the list provided by the fuzzer is not empty and pre-sorted
7#[derive(Debug, Clone, Deserialize, Serialize, Default)]
8pub struct IntegerListInput(pub Vec<u64>);
9
10impl From<IntegerListInput> for IntegerList {
11 fn from(list: IntegerListInput) -> Self {
12 let mut v = list.0;
13 v.sort_unstable();
14 Self::new_pre_sorted(v)
15 }
16}