fixed a bug in TreeHash.rs/list_to_blob
This commit is contained in:
parent
0148abaa0b
commit
cd676d5621
@ -55,8 +55,13 @@ fn list_to_blob(list: &mut Vec<Vec<u8>>) -> (usize, Vec<u8>) {
|
|||||||
list[0].len()
|
list[0].len()
|
||||||
};
|
};
|
||||||
|
|
||||||
let items_per_chunk = SSZ_CHUNK_SIZE / list[0].len();
|
let (items_per_chunk, chunk_count) = if list.is_empty() {
|
||||||
let chunk_count = list.len() / items_per_chunk;
|
(1, 1)
|
||||||
|
} else {
|
||||||
|
let items_per_chunk = SSZ_CHUNK_SIZE / list[0].len();
|
||||||
|
let chunk_count = list.len() / items_per_chunk;
|
||||||
|
(items_per_chunk, chunk_count)
|
||||||
|
};
|
||||||
|
|
||||||
let mut chunkz = Vec::new();
|
let mut chunkz = Vec::new();
|
||||||
if list.is_empty() {
|
if list.is_empty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user