protolambda 64f012b276
Move test-generators to specs repo
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>
2019-03-28 00:49:04 +08:00

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)