@@ -186,6 +186,24 @@ def type_aware_apply_formatters_to_dict_keys_and_values(
186
186
)
187
187
188
188
189
+ def apply_list_to_array_formatter (formatter : Any ) -> Callable [..., Any ]:
190
+ return to_list (apply_formatter_to_array (formatter ))
191
+
192
+
193
+ ACCESS_LIST_FORMATTER = type_aware_apply_formatters_to_dict (
194
+ {
195
+ "address" : to_checksum_address ,
196
+ "storageKeys" : apply_list_to_array_formatter (to_hexbytes (64 )),
197
+ }
198
+ )
199
+
200
+ ACCESS_LIST_RESPONSE_FORMATTER = type_aware_apply_formatters_to_dict (
201
+ {
202
+ "accessList" : apply_list_to_array_formatter (ACCESS_LIST_FORMATTER ),
203
+ "gasUsed" : to_integer_if_hex ,
204
+ }
205
+ )
206
+
189
207
TRANSACTION_RESULT_FORMATTERS = {
190
208
"blockHash" : apply_formatter_if (is_not_null , to_hexbytes (32 )),
191
209
"blockNumber" : apply_formatter_if (is_not_null , to_integer_if_hex ),
@@ -210,13 +228,7 @@ def type_aware_apply_formatters_to_dict_keys_and_values(
210
228
"chainId" : apply_formatter_if (is_not_null , to_integer_if_hex ),
211
229
"accessList" : apply_formatter_if (
212
230
is_not_null ,
213
- apply_formatter_to_array (
214
- type_aware_apply_formatters_to_dict (
215
- {
216
- "address" : to_checksum_address ,
217
- }
218
- )
219
- ),
231
+ apply_formatter_to_array (ACCESS_LIST_FORMATTER ),
220
232
),
221
233
"input" : HexBytes ,
222
234
"data" : HexBytes , # Nethermind, for example, returns both `input` and `data`
@@ -238,10 +250,6 @@ def type_aware_apply_formatters_to_dict_keys_and_values(
238
250
)
239
251
240
252
241
- def apply_list_to_array_formatter (formatter : Any ) -> Callable [..., Any ]:
242
- return to_list (apply_formatter_to_array (formatter ))
243
-
244
-
245
253
LOG_ENTRY_FORMATTERS = {
246
254
"blockHash" : apply_formatter_if (is_not_null , to_hexbytes (32 )),
247
255
"blockNumber" : apply_formatter_if (is_not_null , to_integer_if_hex ),
@@ -517,6 +525,7 @@ def apply_list_to_array_formatter(formatter: Any) -> Callable[..., Any]:
517
525
(is_length (3 ), call_with_override ),
518
526
)
519
527
),
528
+ RPC .eth_createAccessList : apply_formatter_at_index (transaction_param_formatter , 0 ),
520
529
RPC .eth_estimateGas : apply_one_of_formatters (
521
530
(
522
531
(is_length (1 ), estimate_gas_without_block_id ),
@@ -682,6 +691,7 @@ def subscription_formatter(value: Any) -> Union[HexBytes, HexStr, Dict[str, Any]
682
691
RPC .eth_chainId : to_integer_if_hex ,
683
692
RPC .eth_coinbase : to_checksum_address ,
684
693
RPC .eth_call : HexBytes ,
694
+ RPC .eth_createAccessList : ACCESS_LIST_RESPONSE_FORMATTER ,
685
695
RPC .eth_estimateGas : to_integer_if_hex ,
686
696
RPC .eth_feeHistory : fee_history_formatter ,
687
697
RPC .eth_maxPriorityFeePerGas : to_integer_if_hex ,
0 commit comments