We could either try to make the new class a subclass of SignableMessage (not just duck typing with the same attributes, but something that would make mypy typecheck it correctly), or add a method like as_signable_message() to build an instance of that class.
While we're making this change, we could add an as_abi_tuple() method that will return a tuple usable in contract calls, e.g.:
From the TODO here:
https://github.com/ApeWorX/eip712/blob/0832ca92a29b2cae97dab78437d4ac491c140f15/eip712/messages.py#L70
We would like our new
EIP712Message
class to be interoperable with eth-account'sSignableMessage
:https://github.com/ethereum/eth-account/blob/34fd5907d35e85b22212ecfff125e3f4cbb8c2ec/eth_account/messages.py#L39
We could either try to make the new class a subclass of
SignableMessage
(not just duck typing with the same attributes, but something that would make mypy typecheck it correctly), or add a method likeas_signable_message()
to build an instance of that class.While we're making this change, we could add an
as_abi_tuple()
method that will return a tuple usable in contract calls, e.g.: