Skip to content

Commit 470a26b

Browse files
author
Stuart Reed
committed
Docs
1 parent 6ea308a commit 470a26b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/web3.contract.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,17 @@ Utils
11781178
'_debatingPeriod': 604800,
11791179
'_newCurator': True})
11801180
1181+
.. py:module:: web3.contract.utils
1182+
1183+
.. py:method:: utils.get_event_data(abi_codec, event_abi log_entry)
1184+
1185+
Get decoded event data from a log entry using an event ABI.
1186+
1187+
.. py:method:: utils.get_function_info(fn_name, abi_codec, contract_abi, fn_abi, args, kwargs)
1188+
1189+
Get function signature and information from a contract ABI given a name, contract ABI, function ABI, and arguments.
1190+
1191+
11811192
ContractCaller
11821193
--------------
11831194

web3/contract/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ def get_function_info(
291291
args: Optional[Sequence[Any]] = None,
292292
kwargs: Optional[Any] = None,
293293
) -> Tuple[ABIFunction, HexStr, Tuple[Any, ...]]:
294+
"""
295+
Given a function name, contract ABI, function ABI, and function arguments
296+
return the contract function ABI, selector and arguments
297+
"""
294298
return _get_function_info(fn_name, abi_codec, contract_abi, fn_abi, args, kwargs)
295299

296300

@@ -300,6 +304,10 @@ def get_event_data(
300304
event_abi: ABIEvent,
301305
log_entry: LogReceipt,
302306
) -> EventData:
307+
"""
308+
Given an event ABI and a log entry for that event, return the decoded
309+
event data
310+
"""
303311
return _get_event_data(abi_codec, event_abi, log_entry)
304312

305313

0 commit comments

Comments
 (0)