@@ -16,20 +16,24 @@ use starknet_in_rust::{
1616 block_context:: BlockContext ,
1717 constants:: { DECLARE_VERSION , TRANSACTION_VERSION } ,
1818 } ,
19- execution:: { execution_entry_point:: ExecutionEntryPoint , TransactionExecutionContext } ,
19+ execution:: {
20+ execution_entry_point:: { ExecutionEntryPoint , ExecutionResult } ,
21+ TransactionExecutionContext ,
22+ } ,
2023 hash_utils:: calculate_contract_address,
2124 parser_errors:: ParserError ,
2225 serde_structs:: read_abi,
2326 services:: api:: contract_classes:: deprecated_contract_class:: ContractClass ,
24- state:: {
25- cached_state:: CachedState ,
26- state_api:: { State , StateReader } ,
27- } ,
27+ state:: { cached_state:: CachedState , state_api:: State } ,
2828 state:: { in_memory_state_reader:: InMemoryStateReader , ExecutionResourcesManager } ,
29- transaction:: InvokeFunction ,
29+ transaction:: { error :: TransactionError , InvokeFunction } ,
3030 utils:: { felt_to_hash, string_to_hash, Address } ,
3131} ;
32- use std:: { collections:: HashMap , path:: PathBuf , sync:: Mutex } ;
32+ use std:: {
33+ collections:: HashMap ,
34+ path:: PathBuf ,
35+ sync:: { Arc , Mutex } ,
36+ } ;
3337
3438#[ derive( Parser ) ]
3539struct Cli {
@@ -248,13 +252,18 @@ fn call_parser(
248252 None ,
249253 0 ,
250254 ) ;
251- let call_info = execution_entry_point. execute (
255+ let block_context = BlockContext :: default ( ) ;
256+ let ExecutionResult { call_info, .. } = execution_entry_point. execute (
252257 cached_state,
253- & BlockContext :: default ( ) ,
258+ & block_context ,
254259 & mut ExecutionResourcesManager :: default ( ) ,
255260 & mut TransactionExecutionContext :: default ( ) ,
256261 false ,
262+ block_context. invoke_tx_max_n_steps ( ) ,
257263 ) ?;
264+
265+ let call_info = call_info. ok_or ( TransactionError :: CallInfoIsNone ) ?;
266+
258267 Ok ( call_info. retdata )
259268}
260269
@@ -303,7 +312,7 @@ async fn call_req(data: web::Data<AppState>, args: web::Json<CallArgs>) -> HttpR
303312pub async fn start_devnet ( port : u16 ) -> Result < ( ) , std:: io:: Error > {
304313 let cached_state = web:: Data :: new ( AppState {
305314 cached_state : Mutex :: new ( CachedState :: < InMemoryStateReader > :: new (
306- InMemoryStateReader :: default ( ) ,
315+ Arc :: new ( InMemoryStateReader :: default ( ) ) ,
307316 Some ( HashMap :: new ( ) ) ,
308317 None ,
309318 ) ) ,
0 commit comments