From 7c4232455c305b58143d9f62dfd29ebbaa2eb5e2 Mon Sep 17 00:00:00 2001 From: Vitalik Buterin Date: Fri, 14 Jun 2019 14:07:25 -0400 Subject: [PATCH] Added get_container_type to get_zero_value --- test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py b/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py index dbc3f9523..de54bbf05 100644 --- a/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py +++ b/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py @@ -118,6 +118,8 @@ class Container(object): def get_zero_value(typ): if typ == int: return 0 + elif is_container_type(typ): + return typ(**{f: get_zero_value(t) for f, t in typ.get_fields()}) else: return typ.default()