diff --git a/safe_eth/util/util.py b/safe_eth/util/util.py index f4f9048cb..2d3640386 100644 --- a/safe_eth/util/util.py +++ b/safe_eth/util/util.py @@ -1,5 +1,7 @@ from typing import Any, Iterable, Sequence +from eth_typing import HexStr + def chunks(elements: Sequence[Any], n: int) -> Iterable[Any]: """ @@ -11,11 +13,11 @@ def chunks(elements: Sequence[Any], n: int) -> Iterable[Any]: yield elements[i : i + n] -def to_0x_hex_str(value: bytes) -> str: +def to_0x_hex_str(value: bytes) -> HexStr: """ Convert bytes to a 0x-prefixed hex string :param value: bytes value :return: 0x-prefixed hex string """ - return "0x" + value.hex() + return HexStr("0x" + value.hex())