diff --git a/src/erc7730/convert/convert_eip712_to_erc7730.py b/src/erc7730/convert/convert_eip712_to_erc7730.py index 11f23df..612aa77 100644 --- a/src/erc7730/convert/convert_eip712_to_erc7730.py +++ b/src/erc7730/convert/convert_eip712_to_erc7730.py @@ -10,6 +10,9 @@ from eip712 import ( EIP712Format as LegacyEIP712Format, ) +from eip712 import ( + EIP712MessageDescriptor as LegacyEIP712MessageDescriptor, +) from pydantic import AnyUrl from erc7730.common.output import OutputAdder @@ -53,9 +56,8 @@ def convert( # TODO improve typing on EIP-712 library schema = typing.cast(dict[str, list[EIP712Field]], message.schema_) mapper = message.mapper - # FIXME this is wrong, - # see https://github.com/LedgerHQ/clear-signing-erc7730-registry/pull/21/files#r1785706984 - primary_type = mapper.label + # TODO make this public on EIP-712 library + primary_type = LegacyEIP712MessageDescriptor._schema_top_level_type(schema) schemas.append(EIP712JsonSchema(primaryType=primary_type, types=schema)) fields = [self._convert_field(field) for field in mapper.fields] formats[primary_type] = InputFormat(intent=None, fields=fields, required=None, screens=None)