diff --git a/src/telliot_feeds/cli/utils.py b/src/telliot_feeds/cli/utils.py index 94d42686..9bc54808 100644 --- a/src/telliot_feeds/cli/utils.py +++ b/src/telliot_feeds/cli/utils.py @@ -2,8 +2,8 @@ import os from typing import Any from typing import Callable -from typing import Dict from typing import cast +from typing import Dict from typing import get_args from typing import get_type_hints from typing import Optional @@ -478,6 +478,8 @@ async def call_oracle( except ValueError as e: if "no gas strategy selected" in str(e): click.echo("Can't set gas fees automatically. Please specify gas fees manually.") + + class CustomHexBytes(HexBytes): """Wrapper around HexBytes that doesn't accept int or bool""" diff --git a/tests/cli/test_utils.py b/tests/cli/test_utils.py index f60899c8..ae63787a 100644 --- a/tests/cli/test_utils.py +++ b/tests/cli/test_utils.py @@ -1,11 +1,10 @@ from unittest import mock import pytest +from hexbytes import HexBytes from telliot_feeds.cli.utils import build_query from telliot_feeds.cli.utils import call_oracle -from hexbytes import HexBytes - from telliot_feeds.cli.utils import CustomHexBytes from telliot_feeds.queries.abi_query import AbiQuery from telliot_feeds.queries.price.spot_price import SpotPrice @@ -83,6 +82,8 @@ def __init__(self): user_inputs=user_inputs, ) assert "withdrawStake transaction succeeded" in caplog.text + + def test_custom_hexbytes_wrapper(): """Test custom hexbytes wrapper.""" # test when 0x is present and not present