Fixes to diff checks in EF tests

This commit is contained in:
Michael Sproul
2022-09-14 16:04:14 +10:00
parent 69584aa348
commit a2228d8599
3 changed files with 46 additions and 3 deletions

View File

@@ -127,8 +127,15 @@ impl<E: EthSpec> Case for SanityBlocks<E> {
};
compare_beacon_state_results_without_caches(&mut indiv_result, &mut expected)?;
compare_beacon_state_results_without_caches(&mut bulk_result, &mut expected)?;
check_state_diff(&self.pre, &self.post)?;
// Check state diff (requires fully built committee caches).
let mut pre = self.pre.clone();
pre.build_all_committee_caches(spec).unwrap();
let post = self.post.clone().map(|mut post| {
post.build_all_committee_caches(spec).unwrap();
post
});
check_state_diff(&pre, &post)?;
Ok(())
}
}

View File

@@ -68,6 +68,14 @@ impl<E: EthSpec> Case for SanitySlots<E> {
.map(|_| state);
compare_beacon_state_results_without_caches(&mut result, &mut expected)?;
check_state_diff(&self.pre, &self.post)
// Check state diff (requires fully built committee caches).
let mut pre = self.pre.clone();
pre.build_all_committee_caches(spec).unwrap();
let post = self.post.clone().map(|mut post| {
post.build_all_committee_caches(spec).unwrap();
post
});
check_state_diff(&pre, &post)
}
}