prysmaticlabs / prysm

Unused parameter in function RVV-B0012
Bug risk
Minor
4 hours ago3 years old
parameter 'epoch' seems to be unused, consider removing or renaming it as _
649//	    has_max_effective_balance = validator.effective_balance == MAX_EFFECTIVE_BALANCE
650//	    has_excess_balance = balance > MAX_EFFECTIVE_BALANCE
651//	    return has_eth1_withdrawal_credential(validator) and has_max_effective_balance and has_excess_balance
652func isPartiallyWithdrawableValidatorCapella(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool {653	hasMaxBalance := val.EffectiveBalance == params.BeaconConfig().MaxEffectiveBalance
654	hasExcessBalance := balance > params.BeaconConfig().MaxEffectiveBalance
655	return HasETH1WithdrawalCredential(val) && hasExcessBalance && hasMaxBalance
parameter 'epoch' seems to be unused, consider removing or renaming it as _
627//	    and has_max_effective_balance
628//	    and has_excess_balance
629//	)
630func isPartiallyWithdrawableValidatorElectra(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool {631	maxEB := ValidatorMaxEffectiveBalance(val)
632	hasMaxBalance := val.EffectiveBalance == maxEB
633	hasExcessBalance := balance > maxEB
parameter 'object' seems to be unused, consider removing or renaming it as _
 15	common.RunSSZStaticTests(t, config, "electra", UnmarshalledSSZ, customHtr)
 16}
 17
 18func customHtr(t *testing.T, htrs []common.HTR, object interface{}) []common.HTR { 19	// TODO: Replace BeaconStateDeneb with BeaconStateElectra below and uncomment the code
 20	//_, ok := object.(*ethpb.BeaconStateDeneb)
 21	//if !ok {
parameter 't' seems to be unused, consider removing or renaming it as _
 15	common.RunSSZStaticTests(t, config, "electra", UnmarshalledSSZ, customHtr)
 16}
 17
 18func customHtr(t *testing.T, htrs []common.HTR, object interface{}) []common.HTR { 19	// TODO: Replace BeaconStateDeneb with BeaconStateElectra below and uncomment the code
 20	//_, ok := object.(*ethpb.BeaconStateDeneb)
 21	//if !ok {
parameter 'ctx' seems to be unused, consider removing or renaming it as _
 56
 57// AllDeposits returns a list of historical deposits until the given block number
 58// (inclusive). If no block is specified then this method returns all historical deposits.
 59func (c *Cache) AllDeposits(ctx context.Context, untilBlk *big.Int) []*ethpb.Deposit { 60	c.depositsLock.RLock()
 61	defer c.depositsLock.RUnlock()
 62