Skip to content
Snippets Groups Projects
Commit e9eeeaef authored by PERENNOU Tanguy's avatar PERENNOU Tanguy
Browse files

fix: signal incompatibility in fec::decode

Needs review: stupid copy of fec::recode_random code.
parent 010af348
No related branches found
No related tags found
1 merge request!184Draft: Doc joss
Pipeline #6757 failed
...@@ -445,6 +445,28 @@ pub fn decode<F: PrimeField>(shards: Vec<Shard<F>>) -> Result<Vec<u8>, KomodoErr ...@@ -445,6 +445,28 @@ pub fn decode<F: PrimeField>(shards: Vec<Shard<F>>) -> Result<Vec<u8>, KomodoErr
return Err(KomodoError::TooFewShards(np, k as usize)); return Err(KomodoError::TooFewShards(np, k as usize));
} }
// TODO: review code below, borrowed from recode_random()
for (i, (s1, s2)) in shards.iter().zip(shards.iter().skip(1)).enumerate() {
  • Owner

    looks to me like this is now used in multiple places, maybe it will be time to refactor after this

  • Please register or sign in to reply
if s1.k != s2.k {
return Err(KomodoError::IncompatibleShards(format!(
"k is not the same at {}: {} vs {}",
i, s1.k, s2.k
)));
}
if s1.hash != s2.hash {
return Err(KomodoError::IncompatibleShards(format!(
"hash is not the same at {}: {:?} vs {:?}",
i, s1.hash, s2.hash
)));
}
if s1.size != s2.size {
return Err(KomodoError::IncompatibleShards(format!(
"size is not the same at {}: {} vs {}",
i, s1.size, s2.size
)));
}
}
let encoding_mat = Matrix::from_vec_vec( let encoding_mat = Matrix::from_vec_vec(
shards shards
.iter() .iter()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment