mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Fix deep source complains (#8714)
This commit is contained in:
@@ -152,7 +152,7 @@ func verifyExitConditions(validator iface.ReadOnlyValidator, currentSlot types.S
|
||||
// Verify the validator has been active long enough.
|
||||
if currentEpoch < validator.ActivationEpoch()+params.BeaconConfig().ShardCommitteePeriod {
|
||||
return fmt.Errorf(
|
||||
"%s: %d of %d epochs. Validator will be eligible for exit at epoch %d.",
|
||||
"%s: %d of %d epochs. Validator will be eligible for exit at epoch %d",
|
||||
ValidatorCannotExitYetMsg,
|
||||
currentEpoch-validator.ActivationEpoch(),
|
||||
params.BeaconConfig().ShardCommitteePeriod,
|
||||
|
||||
@@ -368,7 +368,7 @@ func aggregatorsPerSlot(activeValidators uint64) uint64 {
|
||||
}
|
||||
|
||||
// provides the relevant score by the provided weight and threshold.
|
||||
func scoreByWeight(weight float64, threshold float64) float64 {
|
||||
func scoreByWeight(weight, threshold float64) float64 {
|
||||
return maxScore() / (weight * threshold * threshold)
|
||||
}
|
||||
|
||||
|
||||
@@ -533,16 +533,6 @@ func (b *BeaconState) ValidatorIndexByPubkey(key [48]byte) (types.ValidatorIndex
|
||||
return idx, ok
|
||||
}
|
||||
|
||||
func (b *BeaconState) validatorIndexMap() map[[48]byte]types.ValidatorIndex {
|
||||
if b == nil || b.valMapHandler == nil || b.valMapHandler.IsNil() {
|
||||
return map[[48]byte]types.ValidatorIndex{}
|
||||
}
|
||||
b.lock.RLock()
|
||||
defer b.lock.RUnlock()
|
||||
|
||||
return b.valMapHandler.Copy().ValidatorIndexMap()
|
||||
}
|
||||
|
||||
// PubkeyAtIndex returns the pubkey at the given
|
||||
// validator index.
|
||||
func (b *BeaconState) PubkeyAtIndex(idx types.ValidatorIndex) [48]byte {
|
||||
|
||||
@@ -57,7 +57,6 @@ func TestNilState_NoPanic(t *testing.T) {
|
||||
_, err = st.ValidatorAtIndexReadOnly(0)
|
||||
_ = err
|
||||
_, _ = st.ValidatorIndexByPubkey([48]byte{})
|
||||
_ = st.validatorIndexMap()
|
||||
_ = st.PubkeyAtIndex(0)
|
||||
_ = st.NumValidators()
|
||||
_ = st.Balances()
|
||||
|
||||
Reference in New Issue
Block a user