@@ -48,11 +48,14 @@ use katana_rpc_types::trie::{
4848 ClassesProof , ContractLeafData , ContractStorageKeys , ContractStorageProofs , ContractsProof ,
4949 GetStorageProofResponse , GlobalRoots , Nodes ,
5050} ;
51- use katana_rpc_types:: { FeeEstimate , TxStatus } ;
51+ use katana_rpc_types:: {
52+ FeeEstimate , PreConfirmedBlockWithReceipts , PreConfirmedBlockWithTxs , TxStatus ,
53+ } ;
5254use katana_rpc_types_builder:: { BlockBuilder , ReceiptBuilder } ;
5355use katana_tasks:: { Result as TaskResult , TaskSpawner } ;
5456
5557use crate :: permit:: Permits ;
58+ use crate :: starknet:: pending:: PendingBlockProvider2 ;
5659use crate :: utils:: events:: { Cursor , EventBlockId } ;
5760use crate :: { utils, DEFAULT_ESTIMATE_FEE_MAX_CONCURRENT_REQUESTS } ;
5861
@@ -341,7 +344,13 @@ where
341344 else {
342345 let num = provider. latest_number ( ) ?;
343346 let mut env = provider. block_env_at ( num. into ( ) ) ?. expect ( "missing block env" ) ;
344- self . inner . backend . update_block_env ( & mut env) ;
347+
348+ env. number += 1 ;
349+ env. timestamp = get_current_timestamp ( ) . as_secs ( ) as u64 ;
350+ env. l2_gas_prices = self . inner . gas_oracle . l2_gas_prices ( ) ;
351+ env. l1_gas_prices = self . inner . gas_oracle . l1_gas_prices ( ) ;
352+ env. l1_data_gas_prices = self . inner . gas_oracle . l1_data_gas_prices ( ) ;
353+
345354 Some ( env)
346355 }
347356 }
@@ -680,9 +689,11 @@ where
680689 . build ( ) ?
681690 . map ( MaybePreConfirmedBlock :: Confirmed ) ;
682691
683- StarknetApiResult :: Ok ( block)
684- } else {
685- StarknetApiResult :: Ok ( None )
692+ StarknetApiResult :: Ok ( block)
693+ } else {
694+ StarknetApiResult :: Ok ( None )
695+ }
696+ }
686697 }
687698 } )
688699 . await ??;
@@ -717,9 +728,11 @@ where
717728 . build_with_receipts ( ) ?
718729 . map ( GetBlockWithReceiptsResponse :: Block ) ;
719730
720- StarknetApiResult :: Ok ( block)
721- } else {
722- StarknetApiResult :: Ok ( None )
731+ StarknetApiResult :: Ok ( block)
732+ } else {
733+ StarknetApiResult :: Ok ( None )
734+ }
735+ }
723736 }
724737 } )
725738 . await ??;
@@ -754,9 +767,11 @@ where
754767 . build_with_tx_hash ( ) ?
755768 . map ( GetBlockWithTxHashesResponse :: Block ) ;
756769
757- StarknetApiResult :: Ok ( block)
758- } else {
759- StarknetApiResult :: Ok ( None )
770+ StarknetApiResult :: Ok ( block)
771+ } else {
772+ StarknetApiResult :: Ok ( None )
773+ }
774+ }
760775 }
761776 } )
762777 . await ??;
0 commit comments