diff --git a/EIPS/eip-7495.md b/EIPS/eip-7495.md index 9dbf2fbc58fb83..f76cf5423491f4 100644 --- a/EIPS/eip-7495.md +++ b/EIPS/eip-7495.md @@ -75,12 +75,9 @@ Serialization of `StableContainer[N]` is defined similarly to the [existing logi - If variable-length fields are serialized, their offsets are relative to the start of serialized active fields, after the `Bitvector[N]` ```python -def is_active_field(element): - return not is_optional(element) or element is not None - # Determine active fields -active_fields = Bitvector[N](([is_active_field(element) for element in value] + [False] * N)[:N]) -active_values = [element for element in value if is_active_field(element)] +active_fields = Bitvector[N](([element is not None for element in value] + [False] * N)[:N]) +active_values = [element for element in value if element is not None] # Recursively serialize fixed_parts = [serialize(element) if not is_variable_size(element) else None for element in active_values] @@ -120,7 +117,7 @@ To merkleize a `StableContainer[N]`, a `Bitvector[N]` is constructed, indicating Merkleization `hash_tree_root(value)` of an object `value` is extended with: -- `mix_in_aux(merkleize(([hash_tree_root(element) if is_active_field(element) else Bytes32() for element in value.data] + [Bytes32()] * N)[:N]), hash_tree_root(value.active_fields))` if `value` is a `StableContainer[N]`. +- `mix_in_aux(merkleize(([hash_tree_root(element) if element is not None else Bytes32() for element in value.data] + [Bytes32()] * N)[:N]), hash_tree_root(value.active_fields))` if `value` is a `StableContainer[N]`. ### `Profile[B]`