Fix BeaconChain tests
This commit is contained in:
parent
fcf16faad3
commit
8d5a579aa6
@ -90,11 +90,11 @@ fn test_active_index<T: EthSpec>(state_slot: Slot) {
|
|||||||
|
|
||||||
// Test the start and end of the range.
|
// Test the start and end of the range.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
state.get_active_index_root_index(*range.start(), &spec),
|
state.get_active_index_root_index(*range.start(), &spec, AllowNextEpoch::False),
|
||||||
Ok(modulo(*range.start()))
|
Ok(modulo(*range.start()))
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
state.get_active_index_root_index(*range.end(), &spec),
|
state.get_active_index_root_index(*range.end(), &spec, AllowNextEpoch::False),
|
||||||
Ok(modulo(*range.end()))
|
Ok(modulo(*range.end()))
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -102,12 +102,12 @@ fn test_active_index<T: EthSpec>(state_slot: Slot) {
|
|||||||
if state.current_epoch() > 0 {
|
if state.current_epoch() > 0 {
|
||||||
// Test is invalid on epoch zero, cannot subtract from zero.
|
// Test is invalid on epoch zero, cannot subtract from zero.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
state.get_active_index_root_index(*range.start() - 1, &spec),
|
state.get_active_index_root_index(*range.start() - 1, &spec, AllowNextEpoch::False),
|
||||||
Err(Error::EpochOutOfBounds)
|
Err(Error::EpochOutOfBounds)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
state.get_active_index_root_index(*range.end() + 1, &spec),
|
state.get_active_index_root_index(*range.end() + 1, &spec, AllowNextEpoch::False),
|
||||||
Err(Error::EpochOutOfBounds)
|
Err(Error::EpochOutOfBounds)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user