Skip to content

Commit

Permalink
fix: loosen pins
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 26, 2024
1 parent 44b4fa9 commit fcaae27
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
13 changes: 7 additions & 6 deletions tests/test_common.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
)


Expand Down
9 changes: 6 additions & 3 deletions tests/test_messages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from eth_account.messages import ValidationError
from eth_utils import to_hex

from .conftest import (
InvalidMessageMissingDomainFields,
Expand All @@ -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():
Expand Down

0 comments on commit fcaae27

Please sign in to comment.