func InitialValidators(num int, keystore validator.Keystore, c *config.Config) ([]primitives.InitialValidatorEntry, error) {
	var validators []primitives.InitialValidatorEntry

	for i := 0; i <= num; i++ {
		key := keystore.GetKeyForValidator(uint32(i))
		pub := key.DerivePublicKey()
		hashPub, err := ssz.HashTreeRoot(pub.Serialize())
		if err != nil {
			return nil, err
		}
		proofOfPossession, err := bls.Sign(key, hashPub[:], bls.DomainDeposit)
		if err != nil {
			return nil, err
		}
		validators = append(validators, primitives.InitialValidatorEntry{
			PubKey:                pub.Serialize(),
			ProofOfPossession:     proofOfPossession.Serialize(),
			WithdrawalShard:       1,
			WithdrawalCredentials: chainhash.Hash{},
			DepositSize:           c.MaxDeposit,
		})
	}

	return validators, nil
}
// InitialValidators gets the initial validators for tests.
InitialValidators gets the initial validators for tests.
// InitialValidators gets the initial validators for tests .
func InitialValidators(num int, keystore validator.Keystore, c *config.Config) ([]primitives.InitialValidatorEntry, error) {
	var validators []primitives.InitialValidatorEntry
	for i := 0; i <= num; i++ {
		key := keystore.GetKeyForValidator(uint32(i))
		pub := key.DerivePublicKey()
		hashPub, err := ssz.HashTreeRoot(pub.Serialize())
		if err != nil {
			return nil, err
		}
		proofOfPossession, err := bls.Sign(key, hashPub[:], bls.DomainDeposit)
		if err != nil {
			return nil, err
		}
		validators = append(validators, primitives.InitialValidatorEntry{
			PubKey:                pub.Serialize(),
			ProofOfPossession:     proofOfPossession.Serialize(),
			WithdrawalShard:       1,
			WithdrawalCredentials: chainhash.Hash{},
			DepositSize:           c.MaxDeposit,
		})
	}
	return validators, nil
}
func InitialValidators ( num int , keystore validator . Keystore , c * config . Config ) ( [ ] primitives . InitialValidatorEntry , error ) { var validators [ ] primitives . InitialValidatorEntry for i := 0 ; i <= num ; i ++ { key := keystore . GetKeyForValidator ( uint32 ( i ) ) pub := key . DerivePublicKey ( ) hashPub , err := ssz . HashTreeRoot ( pub . Serialize ( ) ) if err != nil { return nil , err } proofOfPossession , err := bls . Sign ( key , hashPub [ : ] , bls . DomainDeposit ) if err != nil { return nil , err } validators = append ( validators , primitives . InitialValidatorEntry { PubKey : pub . Serialize ( ) , ProofOfPossession : proofOfPossession . Serialize ( ) , WithdrawalShard : 1 , WithdrawalCredentials : chainhash . Hash { } , DepositSize : c . MaxDeposit , } ) } return validators , nil }
InitialValidators gets the initial validators for tests.
InitialValidators gets the initial validators for tests .