Skip to content

Commit 3d415a6

Browse files
committed
fix hints
1 parent b25ce0f commit 3d415a6

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

faster_web3/_utils/method_formatters.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
Iterable,
1010
Literal,
1111
NoReturn,
12+
Sequence,
1213
Tuple,
13-
TypeVar,
1414
Union,
1515
cast,
1616
)
@@ -110,6 +110,7 @@
110110
SimulateV1Payload,
111111
StateOverrideParams,
112112
TReturn,
113+
TValue,
113114
TxParams,
114115
_Hash32,
115116
)
@@ -119,8 +120,8 @@
119120
from faster_web3.eth import Eth # noqa: F401
120121
from faster_web3.module import Module # noqa: F401
121122

122-
TValue = TypeVar("TValue")
123-
123+
Trace = Dict[str, Any]
124+
Traces = Sequence[Trace]
124125

125126
def bytes_to_ascii(value: bytes) -> str:
126127
return codecs.decode(value, "ascii")
@@ -962,14 +963,17 @@ def pretrace_formatter(
962963
)
963964

964965
# trace formatter for a list of traces
965-
trace_list_result_formatter: Final[Callable[[Formatters], Any]] = (
966-
apply_formatter_to_array(
967-
TRACE_FORMATTERS,
968-
)
966+
trace_list_result_formatter: Final[Callable[[Traces], Any]] = (
967+
apply_formatter_to_array(TRACE_FORMATTERS)
969968
)
970969

971970
# shared formatter for common `tracing` module rpc responses
972-
common_tracing_result_formatter: Final = type_aware_apply_formatters_to_dict(
971+
common_tracing_result_formatter: Final[
972+
Callable[
973+
[Union[Dict[str, Any], AttributeDict[str, Any]]],
974+
Union[Dict[str, Any], ReadableAttributeDict[str, Any]],
975+
]
976+
] = type_aware_apply_formatters_to_dict(
973977
{
974978
"trace": apply_formatter_if(is_not_null, trace_list_result_formatter),
975979
"output": HexBytes,

0 commit comments

Comments
 (0)