mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Fix ups and Clippy
This commit is contained in:
@@ -294,9 +294,9 @@ impl<E: EthSpec, T: EpochTransition<E>> Case for EpochProcessing<E, T> {
|
||||
let mut state = pre_state.clone();
|
||||
let mut expected = self.post.clone();
|
||||
|
||||
expected.as_mut().map(|post_state| {
|
||||
if let Some(post_state) = expected.as_mut() {
|
||||
post_state.build_all_committee_caches(spec).unwrap();
|
||||
});
|
||||
}
|
||||
|
||||
let mut result = T::run(&mut state, spec).map(|_| state);
|
||||
|
||||
|
||||
@@ -386,9 +386,9 @@ impl<E: EthSpec, O: Operation<E>> Case for Operations<E, O> {
|
||||
let mut state = pre_state.clone();
|
||||
let mut expected = self.post.clone();
|
||||
|
||||
expected
|
||||
.as_mut()
|
||||
.map(|post_state| post_state.build_all_committee_caches(spec).unwrap());
|
||||
if let Some(post_state) = expected.as_mut() {
|
||||
post_state.build_all_committee_caches(spec).unwrap();
|
||||
}
|
||||
|
||||
let mut result = self
|
||||
.operation
|
||||
|
||||
@@ -170,7 +170,7 @@ vectors_and_tests!(
|
||||
invalid_exit_already_initiated,
|
||||
ExitTest {
|
||||
state_modifier: Box::new(|state| {
|
||||
state.validators_mut().get_mut(0).unwrap().exit_epoch = STATE_EPOCH + 1;
|
||||
*state.validators_mut().get_mut(0).unwrap().exit_epoch_mut() = STATE_EPOCH + 1;
|
||||
}),
|
||||
expected: Err(BlockProcessingError::ExitInvalid {
|
||||
index: 0,
|
||||
@@ -189,8 +189,11 @@ vectors_and_tests!(
|
||||
invalid_not_active_before_activation_epoch,
|
||||
ExitTest {
|
||||
state_modifier: Box::new(|state| {
|
||||
state.validators_mut().get_mut(0).unwrap().activation_epoch =
|
||||
E::default_spec().far_future_epoch;
|
||||
*state
|
||||
.validators_mut()
|
||||
.get_mut(0)
|
||||
.unwrap()
|
||||
.activation_epoch_mut() = E::default_spec().far_future_epoch;
|
||||
}),
|
||||
expected: Err(BlockProcessingError::ExitInvalid {
|
||||
index: 0,
|
||||
@@ -209,7 +212,7 @@ vectors_and_tests!(
|
||||
invalid_not_active_after_exit_epoch,
|
||||
ExitTest {
|
||||
state_modifier: Box::new(|state| {
|
||||
state.validators_mut().get_mut(0).unwrap().exit_epoch = STATE_EPOCH;
|
||||
*state.validators_mut().get_mut(0).unwrap().exit_epoch_mut() = STATE_EPOCH;
|
||||
}),
|
||||
expected: Err(BlockProcessingError::ExitInvalid {
|
||||
index: 0,
|
||||
|
||||
Reference in New Issue
Block a user