Skip to content

Commit 4b69c54

Browse files
author
Stuart Reed
committed
Add docs for new ABI utils.
Deprecate `get_abi_input_names` and `get_abi_input_names`.
1 parent 66c37e2 commit 4b69c54

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs/web3.utils.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ ABI
1717
1818
Return the ``output`` names an ABI function or event.
1919

20+
21+
.. automodule:: web3.utils.abi
22+
:members:
23+
:undoc-members:
24+
:show-inheritance:
25+
2026
Address
2127
-------
2228

web3/utils/abi.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
from eth_utils.types import (
2929
is_text,
3030
)
31+
from typing_extensions import (
32+
deprecated,
33+
)
3134

3235
from web3._utils.abi import (
3336
abi_to_signature,
@@ -47,13 +50,31 @@
4750
ABIFunction,
4851
)
4952

53+
DEPRECATION_MESSAGE = (
54+
"`{0}` is deprecated and will be removed in a future release. Use " "`{1}` instead."
55+
)
56+
5057

58+
@deprecated(
59+
DEPRECATION_MESSAGE.format(
60+
"get_abi_input_names", "eth_utils.abi.get_abi_output_names"
61+
)
62+
)
63+
@deprecated("Use eth_utils.abi.get_abi_input_names")
5164
def get_abi_input_names(abi: Union[ABIFunction, ABIEvent]) -> List[str]:
65+
"""
66+
Return the ``input`` names for an ABI function or event.
67+
"""
5268
if "inputs" not in abi and abi["type"] == "fallback":
5369
return []
5470
return [arg["name"] for arg in abi["inputs"]]
5571

5672

73+
@deprecated(
74+
DEPRECATION_MESSAGE.format(
75+
"get_abi_output_names", "eth_utils.abi.get_abi_output_names"
76+
)
77+
)
5778
def get_abi_output_names(abi: Union[ABIFunction]) -> List[str]:
5879
if "outputs" not in abi and abi["type"] == "fallback":
5980
return []

0 commit comments

Comments
 (0)