Skip to content

Commit 044a986

Browse files
committed
[v1.5.0] Update test_views_v2.py to use select_safe_encoded_message_hash_by_safe_version for message hash selection
1 parent d5e08e3 commit 044a986

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

safe_transaction_service/history/tests/test_views_v2.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
from ...contracts.models import ContractQuerySet
2727
from ...contracts.tests.factories import ContractFactory
2828
from ...contracts.tx_decoder import DbTxDecoder
29+
from ...safe_messages.utils import (
30+
select_safe_encoded_message_hash_by_safe_version,
31+
)
2932
from ...tokens.models import Token
3033
from ...tokens.tests.factories import TokenFactory
3134
from ...utils.utils import datetime_to_str
@@ -1530,8 +1533,13 @@ def test_post_multisig_transaction_with_1271_signature(self):
15301533
safe_nonce=data["nonce"],
15311534
)
15321535
safe_tx_hash = safe_tx.safe_tx_hash
1536+
safe_tx_hash_preimage = safe_tx.safe_tx_hash_preimage
1537+
1538+
selected_hash = select_safe_encoded_message_hash_by_safe_version(
1539+
safe.get_version(), safe_tx_hash, safe_tx_hash_preimage
1540+
)
15331541

1534-
safe_owner_message_hash = safe_owner.get_message_hash(safe_tx_hash)
1542+
safe_owner_message_hash = safe_owner.get_message_hash(selected_hash)
15351543
safe_owner_signature = account.unsafe_sign_hash(safe_owner_message_hash)[
15361544
"signature"
15371545
]

0 commit comments

Comments
 (0)