From 1bb29be3113390127642a45b71f816269ad8d396 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 21 May 2024 10:56:50 +0200 Subject: [PATCH 1/3] chore: update eth-account and hexbytes --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 04bd584..83fb866 100644 --- a/setup.py +++ b/setup.py @@ -66,11 +66,11 @@ install_requires=[ "dataclassy>=0.8.2,<1", "eth-abi>=5.1.0,<6", - "eth-account>=0.10.0,<0.12", + "eth-account>=0.12.0,<0.14", "eth-hash[pycryptodome]", # NOTE: Pinned by eth-abi "eth-typing>=3.5.2,<4", "eth-utils>=2.3.1,<3", - "hexbytes>=0.3.0,<1", + "hexbytes>=1.2.0,<2", ], python_requires=">=3.8,<4", extras_require=extras_require, From 0b9fd70a03fc72c55e3af32e694f12308a943748 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 21 May 2024 20:57:09 +0200 Subject: [PATCH 2/3] Update tests --- tests/test_common.py | 8 ++++---- tests/test_messages.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_common.py b/tests/test_common.py index 7a950ce..4103e30 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -1,5 +1,5 @@ import pytest -from eth_account._utils.structured_data.hashing import hash_message +from eth_account.messages import encode_typed_data, _hash_eip191_message from hexbytes import HexBytes from eip712.common import SAFE_VERSIONS, create_safe_tx_def @@ -20,12 +20,12 @@ def test_gnosis_safe_tx(version): msg = tx_def(to=MAINNET_MSIG_ADDRESS, nonce=0) assert msg.signable_message.header.hex() == ( - "0x88fbc465dedd7fe71b7baef26a1f46cdaadd50b95c77cbe88569195a9fe589ab" + "88fbc465dedd7fe71b7baef26a1f46cdaadd50b95c77cbe88569195a9fe589ab" if version in ("1.3.0",) - else "0x590e9c66b22ee4584cd655fda57748ce186b85f829a092c28209478efbe86a92" + else "590e9c66b22ee4584cd655fda57748ce186b85f829a092c28209478efbe86a92" ) - assert hash_message(msg).hex() == ( + assert msg.signable_message.body.hex() == ( "3c2fdf2ea8af328a67825162e7686000787c5cc9f4b27cb6bfbcaa445b59e2c4" if version in ("1.3.0",) else "1b393826bed1f2297ffc01916f8339892f9a51dc7f35f477b9a5cdd651d28603" diff --git a/tests/test_messages.py b/tests/test_messages.py index e8839d3..eab7ddd 100644 --- a/tests/test_messages.py +++ b/tests/test_messages.py @@ -10,9 +10,9 @@ def test_multilevel_message(valid_message_with_name_domain_field): msg = valid_message_with_name_domain_field.signable_message - assert msg.version.hex() == "0x01" - assert msg.header.hex() == "0x336a9d2b32d1ab7ea7bbbd2565eca1910e54b74843858dec7a81f772a3c17e17" - assert msg.body.hex() == "0x306af87567fa87e55d2bd925d9a3ed2b1ec2c3e71b142785c053dc60b6ca177b" + assert msg.version.hex() == "01" + assert msg.header.hex() == "336a9d2b32d1ab7ea7bbbd2565eca1910e54b74843858dec7a81f772a3c17e17" + assert msg.body.hex() == "306af87567fa87e55d2bd925d9a3ed2b1ec2c3e71b142785c053dc60b6ca177b" def test_invalid_message_without_domain_fields(): From eed3f8ddbde976f1107d259fd262d2bd687dea39 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 22 May 2024 22:47:29 +0200 Subject: [PATCH 3/3] unused import --- tests/test_common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_common.py b/tests/test_common.py index 4103e30..9a2d678 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -1,5 +1,4 @@ import pytest -from eth_account.messages import encode_typed_data, _hash_eip191_message from hexbytes import HexBytes from eip712.common import SAFE_VERSIONS, create_safe_tx_def