mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
de73baa4a7
* rename last_withdrawal_validator_index * Update Capella methods to Specs #3068 * Add missing renames * rename minimal state Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
34 lines
890 B
Go
34 lines
890 B
Go
package state_native
|
|
|
|
import (
|
|
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
|
"github.com/prysmaticlabs/prysm/v3/runtime/version"
|
|
)
|
|
|
|
// SetNextWithdrawalIndex sets the index that will be assigned to the next withdrawal.
|
|
func (b *BeaconState) SetNextWithdrawalIndex(i uint64) error {
|
|
if b.version < version.Capella {
|
|
return errNotSupported("SetNextWithdrawalIndex", b.version)
|
|
}
|
|
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
b.nextWithdrawalIndex = i
|
|
return nil
|
|
}
|
|
|
|
// SetLastWithdrawalValidatorIndex sets the index of the validator which is
|
|
// next in line for a partial withdrawal.
|
|
func (b *BeaconState) SetNextWithdrawalValidatorIndex(i types.ValidatorIndex) error {
|
|
if b.version < version.Capella {
|
|
return errNotSupported("SetNextWithdrawalValidatorIndex", b.version)
|
|
}
|
|
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
b.nextWithdrawalValidatorIndex = i
|
|
return nil
|
|
}
|