mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-28 22:37:25 +00:00
f8181fa1f2
* erasure-coding: do not panic on 1 validator * tabify fuzz tests * remove num_validators length check * remove unused import * move erasure_coding_fuzzer to fuzzer * change the authors to admit (at) parity.io * Apply suggestions from code review Co-authored-by: Sergei Shulepov <sergei@parity.io> Co-authored-by: Sergei Shulepov <sergei@parity.io>
17 lines
433 B
Rust
17 lines
433 B
Rust
use polkadot_erasure_coding::*;
|
|
use primitives::v1::AvailableData;
|
|
use honggfuzz::fuzz;
|
|
|
|
fn main() {
|
|
loop {
|
|
fuzz!(|data: (usize, Vec<(Vec<u8>, usize)>)| {
|
|
let (num_validators, chunk_input) = data;
|
|
let reconstructed: Result<AvailableData, _> = reconstruct_v1(
|
|
num_validators,
|
|
chunk_input.iter().map(|t| (&*t.0, t.1)).collect::<Vec<(&[u8], usize)>>()
|
|
);
|
|
println!("reconstructed {:?}", reconstructed);
|
|
});
|
|
}
|
|
}
|