|
43 | 43 | check_if_arguments_can_be_encoded,
|
44 | 44 | fallback_func_abi_exists,
|
45 | 45 | filter_by_type,
|
| 46 | + get_abi_input_names, |
| 47 | + get_abi_input_types, |
46 | 48 | get_constructor_abi,
|
47 | 49 | is_array_type,
|
| 50 | + map_abi_data, |
48 | 51 | merge_args_and_kwargs,
|
49 | 52 | receive_func_abi_exists,
|
50 | 53 | )
|
51 | 54 | from web3._utils.contracts import (
|
52 |
| - decode_transaction_data, |
53 | 55 | encode_abi,
|
54 | 56 | find_matching_event_abi,
|
55 | 57 | find_matching_fn_abi,
|
@@ -253,11 +255,16 @@ def decode_function_input(
|
253 | 255 | ) -> Tuple["BaseContractFunction", Dict[str, Any]]:
|
254 | 256 | # type ignored b/c expects data arg to be HexBytes
|
255 | 257 | data = HexBytes(data) # type: ignore
|
256 |
| - func = self.get_function_by_selector(data[:4]) |
257 |
| - arguments = decode_transaction_data( |
258 |
| - func.abi, data, normalizers=BASE_RETURN_NORMALIZERS |
259 |
| - ) |
260 |
| - return func, arguments |
| 258 | + selector, params = data[:4], data[4:] |
| 259 | + func = self.get_function_by_selector(selector) |
| 260 | + |
| 261 | + names = get_abi_input_names(func.abi) |
| 262 | + types = get_abi_input_types(func.abi) |
| 263 | + |
| 264 | + decoded = self.w3.codec.decode(types, cast(HexBytes, params)) |
| 265 | + normalized = map_abi_data(BASE_RETURN_NORMALIZERS, types, decoded) |
| 266 | + |
| 267 | + return func, dict(zip(names, normalized)) |
261 | 268 |
|
262 | 269 | @combomethod
|
263 | 270 | def find_functions_by_args(self, *args: Any) -> "BaseContractFunction":
|
|
0 commit comments