Add tests and modify as_vec implementation (#3715)

* Add tests and modify as_vec implementation

* Address feedback

* fix typo in test
This commit is contained in:
Lldenaurois authored and GitHub committed 2021-09-06 13:24:04 +02:00
1 parent bbf09c96aa
commit 2bd84151ed
6 files changed
+39 -25

No files matched your search

@@ -363,11 +363,9 @@ impl RequestChunksPhase {
let validator_index = chunk.index;
if let Ok(anticipated_hash) = branch_hash(
&params.erasure_root,
&chunk.proof_as_vec(),
chunk.index.0 as usize,
) {
if let Ok(anticipated_hash) =
branch_hash(&params.erasure_root, chunk.proof(), chunk.index.0 as usize)
{
let erasure_chunk_hash = BlakeTwo256::hash(&chunk.chunk);
if erasure_chunk_hash != anticipated_hash {