@@ -126,6 +126,7 @@ async def get_block_with_txs(
126126 ) -> Union [StarknetBlock , PendingStarknetBlock ]:
127127 return await self .get_block (block_hash = block_hash , block_number = block_number )
128128
129+ # TODO (#1323): remove unknown=EXCLUDE after devnet response fix
129130 async def get_block_with_tx_hashes (
130131 self ,
131132 block_hash : Optional [Union [Hash , Tag ]] = None ,
@@ -147,7 +148,7 @@ async def get_block_with_tx_hashes(
147148 )
148149 return cast (
149150 StarknetBlockWithTxHashes ,
150- StarknetBlockWithTxHashesSchema ().load (res , unknown = EXCLUDE ),
151+ StarknetBlockWithTxHashesSchema ().load (res ),
151152 )
152153
153154 async def get_block_with_receipts (
@@ -167,11 +168,11 @@ async def get_block_with_receipts(
167168 if block_identifier == {"block_id" : "pending" }:
168169 return cast (
169170 PendingStarknetBlockWithReceipts ,
170- PendingStarknetBlockWithReceiptsSchema ().load (res , unknown = EXCLUDE ),
171+ PendingStarknetBlockWithReceiptsSchema ().load (res ),
171172 )
172173 return cast (
173174 StarknetBlockWithReceipts ,
174- StarknetBlockWithReceiptsSchema ().load (res , unknown = EXCLUDE ),
175+ StarknetBlockWithReceiptsSchema ().load (res ),
175176 )
176177
177178 # TODO (#809): add tests with multiple emitted keys
@@ -281,6 +282,7 @@ async def _get_events_chunk(
281282 return res ["events" ], res ["continuation_token" ]
282283 return res ["events" ], None
283284
285+ # TODO (#1323): remove unknown=EXCLUDE after devnet fix response
284286 async def get_state_update (
285287 self ,
286288 block_hash : Optional [Union [Hash , Tag ]] = None ,
@@ -300,9 +302,7 @@ async def get_state_update(
300302 PendingBlockStateUpdate ,
301303 PendingBlockStateUpdateSchema ().load (res , unknown = EXCLUDE ),
302304 )
303- return cast (
304- BlockStateUpdate , BlockStateUpdateSchema ().load (res , unknown = EXCLUDE )
305- )
305+ return cast (BlockStateUpdate , BlockStateUpdateSchema ().load (res ))
306306
307307 async def get_storage_at (
308308 self ,
@@ -337,7 +337,7 @@ async def get_transaction(
337337 )
338338 except ClientError as ex :
339339 raise TransactionNotReceivedError () from ex
340- return cast (Transaction , TypesOfTransactionsSchema ().load (res , unknown = EXCLUDE ))
340+ return cast (Transaction , TypesOfTransactionsSchema ().load (res ))
341341
342342 async def get_l1_message_hash (self , tx_hash : Hash ) -> Hash :
343343 """
@@ -358,9 +358,7 @@ async def get_transaction_receipt(self, tx_hash: Hash) -> TransactionReceipt:
358358 method_name = "getTransactionReceipt" ,
359359 params = {"transaction_hash" : _to_rpc_felt (tx_hash )},
360360 )
361- return cast (
362- TransactionReceipt , TransactionReceiptSchema ().load (res , unknown = EXCLUDE )
363- )
361+ return cast (TransactionReceipt , TransactionReceiptSchema ().load (res ))
364362
365363 async def estimate_fee (
366364 self ,
@@ -392,9 +390,7 @@ async def estimate_fee(
392390
393391 return cast (
394392 EstimatedFee ,
395- EstimatedFeeSchema ().load (
396- res , unknown = EXCLUDE , many = (not single_transaction )
397- ),
393+ EstimatedFeeSchema ().load (res , many = not single_transaction ),
398394 )
399395
400396 async def estimate_message_fee (
@@ -440,7 +436,7 @@ async def estimate_message_fee(
440436 ** block_identifier ,
441437 },
442438 )
443- return cast (EstimatedFee , EstimatedFeeSchema ().load (res , unknown = EXCLUDE ))
439+ return cast (EstimatedFee , EstimatedFeeSchema ().load (res ))
444440 except ClientError as err :
445441 if err .code == RPC_CONTRACT_ERROR :
446442 raise ClientError (
@@ -499,9 +495,7 @@ async def send_transaction(self, transaction: Invoke) -> SentTransactionResponse
499495 params = {"invoke_transaction" : params },
500496 )
501497
502- return cast (
503- SentTransactionResponse , SentTransactionSchema ().load (res , unknown = EXCLUDE )
504- )
498+ return cast (SentTransactionResponse , SentTransactionSchema ().load (res ))
505499
506500 async def deploy_account (
507501 self , transaction : DeployAccount
@@ -515,7 +509,7 @@ async def deploy_account(
515509
516510 return cast (
517511 DeployAccountTransactionResponse ,
518- DeployAccountTransactionResponseSchema ().load (res , unknown = EXCLUDE ),
512+ DeployAccountTransactionResponseSchema ().load (res ),
519513 )
520514
521515 async def declare (self , transaction : Declare ) -> DeclareTransactionResponse :
@@ -528,7 +522,7 @@ async def declare(self, transaction: Declare) -> DeclareTransactionResponse:
528522
529523 return cast (
530524 DeclareTransactionResponse ,
531- DeclareTransactionResponseSchema ().load (res , unknown = EXCLUDE ),
525+ DeclareTransactionResponseSchema ().load (res ),
532526 )
533527
534528 async def get_class_hash_at (
@@ -571,9 +565,9 @@ async def get_class_by_hash(
571565 if "sierra_program" in res :
572566 return cast (
573567 SierraContractClass ,
574- SierraContractClassSchema ().load (res , unknown = EXCLUDE ),
568+ SierraContractClassSchema ().load (res ),
575569 )
576- return cast (ContractClass , ContractClassSchema ().load (res , unknown = EXCLUDE ))
570+ return cast (ContractClass , ContractClassSchema ().load (res ))
577571
578572 # Only RPC methods
579573
@@ -602,7 +596,7 @@ async def get_transaction_by_block_id(
602596 "index" : index ,
603597 },
604598 )
605- return cast (Transaction , TypesOfTransactionsSchema ().load (res , unknown = EXCLUDE ))
599+ return cast (Transaction , TypesOfTransactionsSchema ().load (res ))
606600
607601 async def get_block_transaction_count (
608602 self ,
@@ -656,9 +650,9 @@ async def get_class_at(
656650 if "sierra_program" in res :
657651 return cast (
658652 SierraContractClass ,
659- SierraContractClassSchema ().load (res , unknown = EXCLUDE ),
653+ SierraContractClassSchema ().load (res ),
660654 )
661- return cast (ContractClass , ContractClassSchema ().load (res , unknown = EXCLUDE ))
655+ return cast (ContractClass , ContractClassSchema ().load (res ))
662656
663657 async def get_contract_nonce (
664658 self ,
@@ -698,7 +692,7 @@ async def get_transaction_status(self, tx_hash: Hash) -> TransactionStatusRespon
698692 )
699693 return cast (
700694 TransactionStatusResponse ,
701- TransactionStatusResponseSchema ().load (res , unknown = EXCLUDE ),
695+ TransactionStatusResponseSchema ().load (res ),
702696 )
703697
704698 # ------------------------------- Trace API -------------------------------
@@ -719,9 +713,7 @@ async def trace_transaction(
719713 "transaction_hash" : _to_rpc_felt (tx_hash ),
720714 },
721715 )
722- return cast (
723- TransactionTrace , TransactionTraceSchema ().load (res , unknown = EXCLUDE )
724- )
716+ return cast (TransactionTrace , TransactionTraceSchema ().load (res ))
725717
726718 async def simulate_transactions (
727719 self ,
@@ -772,7 +764,7 @@ async def simulate_transactions(
772764 )
773765 return cast (
774766 List [SimulatedTransaction ],
775- SimulatedTransactionSchema ().load (res , unknown = EXCLUDE , many = True ),
767+ SimulatedTransactionSchema ().load (res , many = True ),
776768 )
777769
778770 async def trace_block_transactions (
@@ -799,7 +791,7 @@ async def trace_block_transactions(
799791 )
800792 return cast (
801793 List [BlockTransactionTrace ],
802- BlockTransactionTraceSchema ().load (res , unknown = EXCLUDE , many = True ),
794+ BlockTransactionTraceSchema ().load (res , many = True ),
803795 )
804796
805797
0 commit comments