@@ -32,14 +32,14 @@ use std::sync::Arc;
3232
3333use anyhow:: anyhow;
3434use cainome:: cairo_serde:: CairoSerde ;
35- use cartridge:: vrf:: SignedOutsideExecution ;
3635use http:: { HeaderMap , HeaderName , HeaderValue } ;
3736use jsonrpsee:: core:: { async_trait, RpcResult } ;
3837use jsonrpsee:: http_client:: { HttpClient , HttpClientBuilder } ;
3938use katana_core:: backend:: Backend ;
4039use katana_core:: service:: block_producer:: { BlockProducer , BlockProducerMode } ;
4140use katana_genesis:: constant:: { DEFAULT_STRK_FEE_TOKEN_ADDRESS , DEFAULT_UDC_ADDRESS } ;
42- use katana_pool:: { TransactionPool , TxPool } ;
41+ use katana_pool:: api:: TransactionPool ;
42+ use katana_pool:: TxPool ;
4343use katana_primitives:: chain:: ChainId ;
4444use katana_primitives:: contract:: Nonce ;
4545use katana_primitives:: execution:: Call ;
@@ -53,9 +53,7 @@ use katana_rpc_api::error::cartridge::CartridgeApiError;
5353use katana_rpc_api:: paymaster:: PaymasterApiClient ;
5454use katana_rpc_types:: broadcasted:: AddInvokeTransactionResponse ;
5555use katana_rpc_types:: cartridge:: FeeSource ;
56- use katana_rpc_types:: outside_execution:: {
57- OutsideExecution , OutsideExecutionV2 , OutsideExecutionV3 ,
58- } ;
56+ use katana_rpc_types:: outside_execution:: OutsideExecution ;
5957use katana_rpc_types:: FunctionCall ;
6058use katana_tasks:: { Result as TaskResult , TaskSpawner } ;
6159use paymaster_rpc:: {
@@ -218,7 +216,7 @@ where
218216 let mut calldata = outside_execution. as_felts ( ) ;
219217 calldata. extend ( signature) ;
220218
221- let mut call = Call { contract_address, entry_point_selector, calldata } ;
219+ let mut call: Call = Call { contract_address, entry_point_selector, calldata } ;
222220 let mut user_address: Felt = contract_address. into ( ) ;
223221
224222 #[ cfg( feature = "vrf" ) ]
@@ -231,7 +229,7 @@ where
231229 return Err ( CartridgeApiError :: VrfMissingFollowUpCall ) ;
232230 }
233231
234- if request_random_call. to != vrf_service. account_address ( ) {
232+ if request_random_call. contract_address != vrf_service. account_address ( ) {
235233 return Err ( CartridgeApiError :: VrfInvalidTarget ) ;
236234 }
237235
@@ -247,7 +245,7 @@ where
247245 . await ?;
248246
249247 user_address = result. address . into ( ) ;
250- call = build_execute_from_outside_call_from_vrf_result ( & result) ;
248+ call = result. into ( ) ;
251249 }
252250 }
253251
@@ -353,13 +351,8 @@ where
353351pub fn encode_calls ( calls : Vec < FunctionCall > ) -> Vec < Felt > {
354352 let mut execute_calldata: Vec < Felt > = vec ! [ calls. len( ) . into( ) ] ;
355353 for call in calls {
356- execute_calldata. push ( call. contract_address . into ( ) ) ;
357- execute_calldata. push ( call. entry_point_selector ) ;
358-
359- execute_calldata. push ( call. calldata . len ( ) . into ( ) ) ;
360- execute_calldata. extend_from_slice ( & call. calldata ) ;
354+ execute_calldata. extend ( Call :: cairo_serialize ( & call) ) ;
361355 }
362-
363356 execute_calldata
364357}
365358
@@ -462,20 +455,3 @@ pub async fn craft_deploy_cartridge_controller_tx(
462455 Ok ( None )
463456 }
464457}
465-
466- pub fn build_execute_from_outside_call_from_vrf_result ( result : & SignedOutsideExecution ) -> Call {
467- let ( selector, calldata) = match & result. outside_execution {
468- cartridge:: vrf:: VrfOutsideExecution :: V2 ( v2) => {
469- let mut calldata = OutsideExecutionV2 :: cairo_serialize ( v2) ;
470- calldata. extend ( Vec :: < Felt > :: cairo_serialize ( & result. signature ) ) ;
471- ( selector ! ( "execute_from_outside_v2" ) , calldata)
472- }
473- cartridge:: vrf:: VrfOutsideExecution :: V3 ( v3) => {
474- let mut calldata = OutsideExecutionV3 :: cairo_serialize ( v3) ;
475- calldata. extend ( Vec :: < Felt > :: cairo_serialize ( & result. signature ) ) ;
476- ( selector ! ( "execute_from_outside_v3" ) , calldata)
477- }
478- } ;
479-
480- PaymasterCall { to : result. address , selector, calldata }
481- }
0 commit comments