Skip to content

Commit dd38adf

Browse files
committed
Skip unnecessary inheritance helper class
Was an artifact of a design trick that didn't survive
1 parent bdd1880 commit dd38adf

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

eip712_structs/struct.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@ def __prepare__(mcs, name, bases):
1515
return OrderedDict()
1616

1717

18-
class _EIP712StructTypeHelper(EIP712Type, metaclass=OrderedAttributesMeta):
19-
"""Helper class to map the more complex struct type to the basic type interface.
20-
"""
21-
22-
@classmethod
23-
def __init_subclass__(cls, **kwargs):
24-
super().__init_subclass__(**kwargs)
25-
cls.type_name = cls.__name__
26-
27-
28-
class EIP712Struct(_EIP712StructTypeHelper):
18+
class EIP712Struct(EIP712Type, metaclass=OrderedAttributesMeta):
2919
"""A representation of an EIP712 struct. Subclass it to use it.
3020
3121
Example:
@@ -46,6 +36,11 @@ def __init__(self, **kwargs):
4636
value = typ(**value)
4737
self.values[name] = value
4838

39+
@classmethod
40+
def __init_subclass__(cls, **kwargs):
41+
super().__init_subclass__(**kwargs)
42+
cls.type_name = cls.__name__
43+
4944
def encode_value(self, value=None):
5045
"""Returns the struct's encoded value.
5146

0 commit comments

Comments
 (0)