mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-14 12:46:06 +00:00
64f012b276
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com> Co-authored-by: Danny Ryan <dannyjryan@gmail.com> Co-authored-by: Dmitrii Shmatko <leodex23@gmail.com> Co-authored-by: Jannik Luhn <jannik@brainbot.com> Co-authored-by: Paul Hauner <paul@paulhauner.com> Co-authored-by: protolambda <proto@protolambda.com>
26 lines
660 B
Python
26 lines
660 B
Python
from typing import Any
|
|
|
|
import yaml
|
|
|
|
|
|
class Validator(yaml.YAMLObject):
|
|
"""
|
|
A validator stub containing only the fields relevant for get_shuffling()
|
|
"""
|
|
fields = {
|
|
'activation_epoch': 'uint64',
|
|
'exit_epoch': 'uint64',
|
|
# Extra index field to ease testing/debugging
|
|
'original_index': 'uint64',
|
|
}
|
|
|
|
def __init__(self, **kwargs):
|
|
for k in self.fields.keys():
|
|
setattr(self, k, kwargs.get(k))
|
|
|
|
def __setattr__(self, name: str, value: Any) -> None:
|
|
super().__setattr__(name, value)
|
|
|
|
def __getattribute__(self, name: str) -> Any:
|
|
return super().__getattribute__(name)
|