Skip to content

Commit 58d920c

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 cfc0b11 commit 58d920c

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
@@ -1523,8 +1526,13 @@ def test_post_multisig_transaction_with_1271_signature(self):
15231526
safe_nonce=data["nonce"],
15241527
)
15251528
safe_tx_hash = safe_tx.safe_tx_hash
1529+
safe_tx_hash_preimage = safe_tx.safe_tx_hash_preimage
1530+
1531+
selected_hash = select_safe_encoded_message_hash_by_safe_version(
1532+
safe.get_version(), safe_tx_hash, safe_tx_hash_preimage
1533+
)
15261534

1527-
safe_owner_message_hash = safe_owner.get_message_hash(safe_tx_hash)
1535+
safe_owner_message_hash = safe_owner.get_message_hash(selected_hash)
15281536
safe_owner_signature = account.unsafe_sign_hash(safe_owner_message_hash)[
15291537
"signature"
15301538
]

0 commit comments

Comments
 (0)