-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Labels
test improvementImprove testsImprove tests
Description
Description
In #597 I commented out some of the new block processing tests because they were failing due to the v0.9 update.
Steps to Resolve
Update the commented out tests (tagged with FIXME) in state_processing/src/per_block_processing/tests.rs:
lighthouse/eth2/state_processing/src/per_block_processing/tests.rs
Lines 396 to 425 in 601951a
| /* FIXME: needs updating for v0.9 | |
| #[test] | |
| fn invalid_exit_not_active() { | |
| use std::cmp::max; | |
| let spec = MainnetEthSpec::default_spec(); | |
| let num_exits = 1; | |
| let test_task = ExitTestTask::NotActive; | |
| let num_validators = max(VALIDATOR_COUNT, num_exits); | |
| let builder = get_builder(&spec, EXIT_SLOT_OFFSET, num_validators); | |
| let (block, mut state) = builder.build_with_n_exits(num_exits, test_task, None, None, &spec); | |
| let result = per_block_processing( | |
| &mut state, | |
| &block, | |
| None, | |
| BlockSignatureStrategy::VerifyIndividual, | |
| &spec, | |
| ); | |
| // Expecting NotActive because we manually set the activation_epoch to be in the future | |
| assert_eq!( | |
| result, | |
| Err(BlockProcessingError::ExitInvalid { | |
| index: 0, | |
| reason: ExitInvalid::NotActive(0), | |
| }) | |
| ); | |
| } | |
| */ |
It would be ideal if the updated tests could be made to depend on a minimum number of "magic numbers". Instead we should use spec constants or fields of the state to mutate operations.
You can start on this before v0.9 is merged by checking out the v0.9 branch.
Metadata
Metadata
Assignees
Labels
test improvementImprove testsImprove tests