mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
erasure-coding: do not panic on 1 validator (#2022)
* 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>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user