|
30 | 30 | )
|
31 | 31 |
|
32 | 32 | from web3._utils.formatters import (
|
33 |
| - apply_formatter_to_array, |
34 | 33 | apply_formatters_to_args,
|
35 | 34 | apply_key_map,
|
36 | 35 | hex_to_integer,
|
37 | 36 | integer_to_hex,
|
38 | 37 | is_array_of_dicts,
|
39 | 38 | static_return,
|
40 | 39 | )
|
| 40 | +from web3._utils.method_formatters import ( |
| 41 | + apply_list_to_array_formatter, |
| 42 | +) |
41 | 43 | from web3.middleware import (
|
42 | 44 | construct_formatting_middleware,
|
43 | 45 | )
|
@@ -88,8 +90,8 @@ def is_hexstr(value: Any) -> bool:
|
88 | 90 | "nonce": to_integer_if_hex,
|
89 | 91 | "maxFeePerGas": to_integer_if_hex,
|
90 | 92 | "maxPriorityFeePerGas": to_integer_if_hex,
|
91 |
| - "accessList": apply_formatter_to_array( |
92 |
| - apply_key_map({"storageKeys": "storage_keys"}) |
| 93 | + "accessList": apply_list_to_array_formatter( |
| 94 | + (apply_key_map({"storageKeys": "storage_keys"})) |
93 | 95 | ),
|
94 | 96 | }
|
95 | 97 | transaction_request_formatter = apply_formatters_to_dict(TRANSACTION_REQUEST_FORMATTERS)
|
@@ -142,7 +144,7 @@ def is_hexstr(value: Any) -> bool:
|
142 | 144 |
|
143 | 145 | TRANSACTION_RESULT_FORMATTERS = {
|
144 | 146 | "to": apply_formatter_if(partial(operator.eq, ""), static_return(None)),
|
145 |
| - "access_list": apply_formatter_to_array( |
| 147 | + "access_list": apply_list_to_array_formatter( |
146 | 148 | apply_key_map({"storage_keys": "storageKeys"}),
|
147 | 149 | ),
|
148 | 150 | }
|
@@ -189,7 +191,7 @@ def is_hexstr(value: Any) -> bool:
|
189 | 191 |
|
190 | 192 |
|
191 | 193 | RECEIPT_RESULT_FORMATTERS = {
|
192 |
| - "logs": apply_formatter_to_array(log_result_remapper), |
| 194 | + "logs": apply_list_to_array_formatter(log_result_remapper), |
193 | 195 | }
|
194 | 196 | receipt_result_formatter = apply_formatters_to_dict(RECEIPT_RESULT_FORMATTERS)
|
195 | 197 |
|
@@ -285,15 +287,15 @@ def is_hexstr(value: Any) -> bool:
|
285 | 287 | RPCEndpoint("eth_newPendingTransactionFilter"): integer_to_hex,
|
286 | 288 | RPCEndpoint("eth_getLogs"): apply_formatter_if(
|
287 | 289 | is_array_of_dicts,
|
288 |
| - apply_formatter_to_array(log_result_remapper), |
| 290 | + apply_list_to_array_formatter(log_result_remapper), |
289 | 291 | ),
|
290 | 292 | RPCEndpoint("eth_getFilterChanges"): apply_formatter_if(
|
291 | 293 | is_array_of_dicts,
|
292 |
| - apply_formatter_to_array(log_result_remapper), |
| 294 | + apply_list_to_array_formatter(log_result_remapper), |
293 | 295 | ),
|
294 | 296 | RPCEndpoint("eth_getFilterLogs"): apply_formatter_if(
|
295 | 297 | is_array_of_dicts,
|
296 |
| - apply_formatter_to_array(log_result_remapper), |
| 298 | + apply_list_to_array_formatter(log_result_remapper), |
297 | 299 | ),
|
298 | 300 | # EVM
|
299 | 301 | RPCEndpoint("evm_snapshot"): integer_to_hex,
|
|
0 commit comments