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
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
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 {
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 {
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
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}