mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
Remove dupe info between ChainSpec and EthSpec
This commit is contained in:
@@ -68,7 +68,7 @@ impl<T: Store, E: EthSpec> BitwiseLMDGhost<T, E> {
|
||||
.ok_or_else(|| ForkChoiceError::MissingBeaconState(*state_root))?;
|
||||
|
||||
let active_validator_indices =
|
||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||
current_state.get_active_validator_indices(block_slot.epoch(E::slots_per_epoch()));
|
||||
|
||||
for index in active_validator_indices {
|
||||
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||
|
||||
@@ -68,7 +68,7 @@ impl<T: Store, E: EthSpec> OptimizedLMDGhost<T, E> {
|
||||
.ok_or_else(|| ForkChoiceError::MissingBeaconState(*state_root))?;
|
||||
|
||||
let active_validator_indices =
|
||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||
current_state.get_active_validator_indices(block_slot.epoch(E::slots_per_epoch()));
|
||||
|
||||
for index in active_validator_indices {
|
||||
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||
|
||||
@@ -40,7 +40,7 @@ impl<T: Store, E: EthSpec> SlowLMDGhost<T, E> {
|
||||
.ok_or_else(|| ForkChoiceError::MissingBeaconState(*state_root))?;
|
||||
|
||||
let active_validator_indices =
|
||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||
current_state.get_active_validator_indices(block_slot.epoch(E::slots_per_epoch()));
|
||||
|
||||
for index in active_validator_indices {
|
||||
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||
|
||||
@@ -40,10 +40,10 @@ impl<S: Store, E: EthSpec> TestingForkChoiceBuilder<S, E> {
|
||||
}
|
||||
|
||||
fn get_state<T: EthSpec>(validator_count: usize) -> BeaconState<T> {
|
||||
let spec = &T::spec();
|
||||
let spec = T::default_spec();
|
||||
|
||||
let builder: TestingBeaconStateBuilder<T> =
|
||||
TestingBeaconStateBuilder::from_single_keypair(validator_count, &Keypair::random(), spec);
|
||||
TestingBeaconStateBuilder::from_single_keypair(validator_count, &Keypair::random(), &spec);
|
||||
let (state, _keypairs) = builder.build();
|
||||
state
|
||||
}
|
||||
@@ -58,7 +58,7 @@ fn get_chain_of_blocks<T: EthSpec, U: Store>(
|
||||
validator_count: usize,
|
||||
store: Arc<U>,
|
||||
) -> Vec<(Hash256, BeaconBlock)> {
|
||||
let spec = T::spec();
|
||||
let spec = T::default_spec();
|
||||
let mut blocks_and_roots: Vec<(Hash256, BeaconBlock)> = vec![];
|
||||
let mut unique_hashes = (0..).into_iter().map(|i| Hash256::from(i));
|
||||
let mut random_block = BeaconBlock::random_for_test(&mut XorShiftRng::from_seed([42; 16]));
|
||||
|
||||
Reference in New Issue
Block a user