Convert giant tuple in state_compressor to struct

This commit is contained in:
Lambda 2024-05-20 10:13:01 +00:00 committed by Charles Hall
parent 8d09a7e490
commit edfccea30a
4 changed files with 39 additions and 61 deletions

View file

@ -159,12 +159,12 @@ impl Service {
let (statediffnew, statediffremoved) =
if let Some(parent_stateinfo) = states_parents.last() {
let statediffnew: HashSet<_> = state_ids_compressed
.difference(&parent_stateinfo.1)
.difference(&parent_stateinfo.full_state)
.copied()
.collect();
let statediffremoved: HashSet<_> = parent_stateinfo
.1
.full_state
.difference(&state_ids_compressed)
.copied()
.collect();
@ -231,7 +231,7 @@ impl Service {
let replaces = states_parents
.last()
.map(|info| {
info.1.iter().find(|bytes| {
info.full_state.iter().find(|bytes| {
bytes.starts_with(&shortstatekey.to_be_bytes())
})
})
@ -436,7 +436,7 @@ impl Service {
.load_shortstatehash_info(shortstatehash)?
.pop()
.expect("there is always one layer")
.1;
.full_state;
Ok(full_state
.iter()