@@ -13,7 +13,7 @@ use starknet_in_rust::{
1313 cached_state:: CachedState , in_memory_state_reader:: InMemoryStateReader , state_api:: State ,
1414 ExecutionResourcesManager ,
1515 } ,
16- transaction:: { DeclareV2 , Deploy , DeployAccount , Transaction } ,
16+ transaction:: { DeclareV2 , Deploy , DeployAccount , InvokeFunction , Transaction } ,
1717 utils:: { Address , ClassHash } ,
1818 CasmContractClass , EntryPointType ,
1919} ;
@@ -65,47 +65,32 @@ fn account_panic() {
6565 let mut state = CachedState :: new ( Arc :: new ( state_reader) , contract_class_cache) ;
6666
6767 let entrypoints = contract_class. entry_points_by_type ;
68+
6869 let entrypoint_selector = & entrypoints. external . get ( 0 ) . unwrap ( ) . selector ;
6970
7071 // arguments of contract_a contract
7172 let calldata: Vec < _ > = [ 2 . into ( ) ] . to_vec ( ) ;
7273
7374 // set up remaining structures
7475
75- let entry_point_type = EntryPointType :: External ;
76-
77- let exec_entry_point = ExecutionEntryPoint :: new (
76+ let invoke = InvokeFunction :: new (
7877 contract_address,
79- calldata,
8078 Felt252 :: new ( entrypoint_selector. clone ( ) ) ,
81- account_address. clone ( ) ,
82- entry_point_type,
83- Some ( CallType :: Delegate ) ,
84- Some ( contract_class_hash) ,
85- 100_000_000 ,
86- ) ;
87-
88- let mut tx_execution_context = TransactionExecutionContext :: new (
89- account_address,
90- Felt252 :: zero ( ) ,
91- Vec :: new ( ) ,
9279 0 ,
93- 10 . into ( ) ,
94- block_context. invoke_tx_max_n_steps ( ) ,
9580 TRANSACTION_VERSION . clone ( ) ,
96- ) ;
97- let mut resources_manager = ExecutionResourcesManager :: default ( ) ;
98-
99- let call_info = exec_entry_point
100- . execute (
101- & mut state ,
102- & block_context ,
103- & mut resources_manager ,
104- & mut tx_execution_context ,
105- false ,
106- block_context . invoke_tx_max_n_steps ( ) ,
107- )
108- . expect ( "failed" ) ;
109-
110- dbg ! ( call_info ) ;
81+ calldata ,
82+ vec ! [ ] ,
83+ block_context . starknet_os_config ( ) . chain_id ( ) . clone ( ) ,
84+ Some ( 1 . into ( ) ) ,
85+ )
86+ . unwrap ( ) ;
87+
88+ let tx = Transaction :: InvokeFunction ( invoke ) ;
89+ let call_info = tx
90+ . execute ( & mut state , & block_context , 0 )
91+ . expect ( "failed to invoke" ) ;
92+
93+ dbg ! ( call_info . revert_error ) ;
94+ //dbg!(call_info);
95+ panic ! ( )
11196}
0 commit comments