@@ -22,7 +22,7 @@ use blockifier_reexecution::utils::get_chain_info;
2222use starknet_api:: block:: { BlockHash , BlockInfo } ;
2323use starknet_api:: block_hash:: block_hash_calculator:: { concat_counts, BlockHeaderCommitments } ;
2424use starknet_api:: contract_class:: SierraVersion ;
25- use starknet_api:: core:: { ChainId , ClassHash } ;
25+ use starknet_api:: core:: { ChainId , ClassHash , ContractAddress } ;
2626use starknet_api:: transaction:: fields:: Fee ;
2727use starknet_api:: transaction:: { InvokeTransaction , MessageToL1 , Transaction , TransactionHash } ;
2828use starknet_api:: versioned_constants_logic:: VersionedConstantsTrait ;
@@ -46,10 +46,12 @@ pub(crate) struct BaseBlockInfo {
4646 pub ( crate ) prev_base_block_hash : BlockHash ,
4747}
4848
49- impl TryFrom < ( BlockHeader , ChainId ) > for BaseBlockInfo {
49+ impl TryFrom < ( BlockHeader , ChainId , Option < ContractAddress > ) > for BaseBlockInfo {
5050 type Error = VirtualBlockExecutorError ;
5151
52- fn try_from ( ( header, chain_id) : ( BlockHeader , ChainId ) ) -> Result < Self , Self :: Error > {
52+ fn try_from (
53+ ( header, chain_id, strk_fee_token_address) : ( BlockHeader , ChainId , Option < ContractAddress > ) ,
54+ ) -> Result < Self , Self :: Error > {
5355 let base_block_hash = header. block_hash ;
5456 let prev_base_block_hash = header. parent_hash ;
5557 let base_block_header_commitments = BlockHeaderCommitments {
@@ -70,7 +72,7 @@ impl TryFrom<(BlockHeader, ChainId)> for BaseBlockInfo {
7072 "Failed to convert block header to block info: {e}"
7173 ) )
7274 } ) ?;
73- let chain_info = get_chain_info ( & chain_id) ;
75+ let chain_info = get_chain_info ( & chain_id, strk_fee_token_address ) ;
7476 let mut versioned_constants = VersionedConstants :: get ( & block_info. starknet_version )
7577 . map_err ( |e| {
7678 VirtualBlockExecutorError :: TransactionExecutionError ( format ! (
@@ -316,10 +318,18 @@ pub(crate) struct RpcVirtualBlockExecutor {
316318
317319#[ allow( dead_code) ]
318320impl RpcVirtualBlockExecutor {
319- pub ( crate ) fn new ( node_url : String , chain_id : ChainId , block_id : BlockId ) -> Self {
321+ pub ( crate ) fn new (
322+ node_url : String ,
323+ chain_id : ChainId ,
324+ block_id : BlockId ,
325+ strk_fee_token_address : Option < ContractAddress > ,
326+ ) -> Self {
320327 Self {
321328 rpc_state_reader : RpcStateReader :: new_with_config_from_url (
322- node_url, chain_id, block_id,
329+ node_url,
330+ chain_id,
331+ block_id,
332+ strk_fee_token_address,
323333 ) ,
324334 validate_txs : true ,
325335 }
@@ -340,7 +350,11 @@ impl VirtualBlockExecutor for RpcVirtualBlockExecutor {
340350 . rpc_state_reader
341351 . get_block_header ( )
342352 . map_err ( |e| VirtualBlockExecutorError :: ReexecutionError ( Box :: new ( e) ) ) ?;
343- BaseBlockInfo :: try_from ( ( block_header, self . rpc_state_reader . chain_id . clone ( ) ) )
353+ BaseBlockInfo :: try_from ( (
354+ block_header,
355+ self . rpc_state_reader . chain_id . clone ( ) ,
356+ self . rpc_state_reader . strk_fee_token_address ,
357+ ) )
344358 }
345359
346360 fn state_reader (
0 commit comments