mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
24 lines
867 B
Go
24 lines
867 B
Go
package migration
|
|
|
|
import (
|
|
ethpbv1 "github.com/OffchainLabs/prysm/v7/proto/eth/v1"
|
|
ethpbalpha "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// V1ValidatorToV1Alpha1 converts a v1 validator to v1alpha1.
|
|
func V1ValidatorToV1Alpha1(v1Validator *ethpbv1.Validator) *ethpbalpha.Validator {
|
|
if v1Validator == nil {
|
|
return ðpbalpha.Validator{}
|
|
}
|
|
return ðpbalpha.Validator{
|
|
PublicKey: v1Validator.Pubkey,
|
|
WithdrawalCredentials: v1Validator.WithdrawalCredentials,
|
|
EffectiveBalance: v1Validator.EffectiveBalance,
|
|
Slashed: v1Validator.Slashed,
|
|
ActivationEligibilityEpoch: v1Validator.ActivationEligibilityEpoch,
|
|
ActivationEpoch: v1Validator.ActivationEpoch,
|
|
ExitEpoch: v1Validator.ExitEpoch,
|
|
WithdrawableEpoch: v1Validator.WithdrawableEpoch,
|
|
}
|
|
}
|