55from ape import networks
66from ape .utils import create_tempdir
77from ape_ethereum .ecosystem import DynamicFeeTransaction , StaticFeeTransaction
8- from eip712 .messages import EIP712Message , EIP712Type
8+ from eip712 .messages import EIP712Message , EIP712Domain
99from eth_account .messages import SignableMessage
10- from eth_pydantic_types import HexBytes
10+ from eth_pydantic_types import HexBytes , abi
11+ from pydantic import BaseModel
1112
1213from ape_ledger .accounts import AccountContainer , LedgerAccount
1314from ape_ledger .exceptions import LedgerSigningError
@@ -22,16 +23,18 @@ def patch_device(device_factory):
2223 return device_factory ("accounts" )
2324
2425
25- class Person (EIP712Type ):
26- name : " string" # type: ignore # noqa: F821
27- wallet : " address" # type: ignore # noqa: F821
26+ class Person (BaseModel ):
27+ name : abi . string
28+ wallet : abi . address
2829
2930
3031class Mail (EIP712Message ):
31- _chainId_ : "uint256" = 1 # type: ignore # noqa: F821
32- _name_ : "string" = "Ether Mail" # type: ignore # noqa: F821
33- _verifyingContract_ : "address" = "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" # type: ignore # noqa: F821 E501
34- _version_ : "string" = "1" # type: ignore # noqa: F821
32+ eip712_domain = EIP712Domain (
33+ chainId = 1 ,
34+ name = "Ether Mail" ,
35+ verifyingContract = "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" ,
36+ version = "1" ,
37+ )
3538
3639 sender : Person
3740 receiver : Person
0 commit comments