diff --git a/setup.py b/setup.py index c265b5d..9ae5283 100644 --- a/setup.py +++ b/setup.py @@ -67,10 +67,10 @@ install_requires=[ "dataclassy>=0.11.1,<1", "eth-abi>=5.1.0,<6", - "eth-account>=0.13.1,<0.14", - "eth-typing>=5.0.0,<6", - "eth-utils>=5.0.0,<6", - "hexbytes>=1.2.0,<2", + "eth-account>=0.11.3,<0.14", + "eth-typing>=3.5.2,<6", + "eth-utils>=2.3.1,<6", + "hexbytes>=0.3.1,<2", ], python_requires=">=3.9,<4", extras_require=extras_require, diff --git a/tests/test_common.py b/tests/test_common.py index 9a2d678..ea7bb79 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -1,4 +1,5 @@ import pytest +from eth_utils import to_hex from hexbytes import HexBytes from eip712.common import SAFE_VERSIONS, create_safe_tx_def @@ -18,16 +19,16 @@ def test_gnosis_safe_tx(version): msg = tx_def(to=MAINNET_MSIG_ADDRESS, nonce=0) - assert msg.signable_message.header.hex() == ( - "88fbc465dedd7fe71b7baef26a1f46cdaadd50b95c77cbe88569195a9fe589ab" + assert to_hex(msg.signable_message.header) == ( + "0x88fbc465dedd7fe71b7baef26a1f46cdaadd50b95c77cbe88569195a9fe589ab" if version in ("1.3.0",) - else "590e9c66b22ee4584cd655fda57748ce186b85f829a092c28209478efbe86a92" + else "0x590e9c66b22ee4584cd655fda57748ce186b85f829a092c28209478efbe86a92" ) - assert msg.signable_message.body.hex() == ( - "3c2fdf2ea8af328a67825162e7686000787c5cc9f4b27cb6bfbcaa445b59e2c4" + assert to_hex(msg.signable_message.body) == ( + "0x3c2fdf2ea8af328a67825162e7686000787c5cc9f4b27cb6bfbcaa445b59e2c4" if version in ("1.3.0",) - else "1b393826bed1f2297ffc01916f8339892f9a51dc7f35f477b9a5cdd651d28603" + else "0x1b393826bed1f2297ffc01916f8339892f9a51dc7f35f477b9a5cdd651d28603" ) diff --git a/tests/test_messages.py b/tests/test_messages.py index eab7ddd..e39c143 100644 --- a/tests/test_messages.py +++ b/tests/test_messages.py @@ -1,5 +1,6 @@ import pytest from eth_account.messages import ValidationError +from eth_utils import to_hex from .conftest import ( InvalidMessageMissingDomainFields, @@ -10,9 +11,11 @@ def test_multilevel_message(valid_message_with_name_domain_field): msg = valid_message_with_name_domain_field.signable_message - assert msg.version.hex() == "01" - assert msg.header.hex() == "336a9d2b32d1ab7ea7bbbd2565eca1910e54b74843858dec7a81f772a3c17e17" - assert msg.body.hex() == "306af87567fa87e55d2bd925d9a3ed2b1ec2c3e71b142785c053dc60b6ca177b" + assert to_hex(msg.version) == "0x01" + assert ( + to_hex(msg.header) == "0x336a9d2b32d1ab7ea7bbbd2565eca1910e54b74843858dec7a81f772a3c17e17" + ) + assert to_hex(msg.body) == "0x306af87567fa87e55d2bd925d9a3ed2b1ec2c3e71b142785c053dc60b6ca177b" def test_invalid_message_without_domain_fields():