mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Remove state dependency from core module in consensus/types (#8653)
#8652 - This removes instances of `BeaconStateError` from `eth_spec.rs`, and replaces them directly with `ArithError` which can be trivially converted back to `BeaconStateError` at the call site. - Also moves the state related methods on `ChainSpec` to be methods on `BeaconState` instead. I think this might be a more natural place for them to exist anyway. Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -135,7 +135,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
state
|
||||
.get_validator(proposer_slashing.proposer_index() as usize)?
|
||||
.effective_balance
|
||||
.safe_div(self.spec.whistleblower_reward_quotient_for_state(state))?,
|
||||
.safe_div(state.get_whistleblower_reward_quotient(&self.spec))?,
|
||||
)?;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
state
|
||||
.get_validator(attester_index as usize)?
|
||||
.effective_balance
|
||||
.safe_div(self.spec.whistleblower_reward_quotient_for_state(state))?,
|
||||
.safe_div(state.get_whistleblower_reward_quotient(&self.spec))?,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user