diff --git a/src/transport/msg_providers/onchain_transport.py b/src/transport/msg_providers/onchain_transport.py index fa70c7d1..19933294 100644 --- a/src/transport/msg_providers/onchain_transport.py +++ b/src/transport/msg_providers/onchain_transport.py @@ -4,6 +4,7 @@ from enum import StrEnum from typing import Any, List, Optional +from cryptography.verify_signature import compute_vs from eth_account.account import VRS from eth_typing import ChecksumAddress, HexStr from schema import Schema @@ -45,8 +46,9 @@ def signature_to_r_vs(signature: bytes) -> tuple[VRS, VRS]: - r, _vs = signature[:32], signature[32:] - return HexStr(bytes_to_hex_string(r)), HexStr(bytes_to_hex_string(_vs)) + r, s, v = signature[:32], signature[32:64], signature[64:] + _vs = compute_vs(v, HexStr(s)) + return HexStr(bytes_to_hex_string(r)), HexStr(_vs) class EventParser(abc.ABC): @@ -231,7 +233,6 @@ def _fetch_messages(self) -> List[Any]: filter_params = FilterParams( fromBlock=from_block, - toBlock=latest_block_number, address=self._onchain_address, topics=[self._topics], ) diff --git a/tests/transport/test_onchain_transport.py b/tests/transport/test_data_bus.py similarity index 99% rename from tests/transport/test_onchain_transport.py rename to tests/transport/test_data_bus.py index 7026df92..fd734928 100644 --- a/tests/transport/test_onchain_transport.py +++ b/tests/transport/test_data_bus.py @@ -106,7 +106,7 @@ def mock_receipts(w3: Web3) -> list[EventData]: 40, 2, '0x42eef33d13c4440627c3fab6e3abee85af796ae6f77dcade628b183640b519d0', - '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + '0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 3, ('0x0000000000000000000000000000000000000000000000000000000000000000',), )