@@ -3,9 +3,7 @@ use std::sync::Arc;
33use apollo_class_manager_types:: MockClassManagerClient ;
44use apollo_gateway_config:: compiler_version:: VersionId ;
55use apollo_gateway_config:: config:: GatewayConfig ;
6- use apollo_gateway_types:: gateway_types:: GatewayOutput ;
76use apollo_mempool_types:: communication:: MockMempoolClient ;
8- use apollo_network_types:: network_types:: BroadcastedMessageMetadata ;
97use apollo_proof_manager_types:: MockProofManagerClient ;
108use apollo_transaction_converter:: TransactionConverter ;
119use blockifier_test_utils:: cairo_versions:: { CairoVersion , RunnableCairo1 } ;
@@ -32,7 +30,6 @@ use starknet_api::transaction::fields::{
3230use starknet_api:: { declare_tx_args, deploy_account_tx_args, felt, invoke_tx_args} ;
3331use starknet_types_core:: felt:: Felt ;
3432
35- use crate :: errors:: GatewayResult ;
3633use crate :: gateway:: GenericGateway ;
3734use crate :: proof_archive_writer:: MockProofArchiveWriterTrait ;
3835use crate :: state_reader_test_utils:: { local_test_state_reader_factory, TestStateReaderFactory } ;
@@ -163,23 +160,11 @@ pub fn rpc_tx_for_testing(
163160 }
164161}
165162
166- pub struct GatewayForBenchmark (
167- GenericGateway <
168- StatelessTransactionValidator ,
169- TransactionConverter ,
170- StatefulTransactionValidatorFactory < TestStateReaderFactory > ,
171- > ,
172- ) ;
173-
174- impl GatewayForBenchmark {
175- pub async fn add_tx (
176- & self ,
177- tx : RpcTransaction ,
178- p2p_message_metadata : Option < BroadcastedMessageMetadata > ,
179- ) -> GatewayResult < GatewayOutput > {
180- self . 0 . add_tx ( tx, p2p_message_metadata) . await
181- }
182- }
163+ pub type GatewayForBenchmark = GenericGateway <
164+ StatelessTransactionValidator ,
165+ TransactionConverter ,
166+ StatefulTransactionValidatorFactory < TestStateReaderFactory > ,
167+ > ;
183168
184169pub fn gateway_for_benchmark ( gateway_config : GatewayConfig ) -> GatewayForBenchmark {
185170 let cairo_version = CairoVersion :: Cairo1 ( RunnableCairo1 :: Casm ) ;
@@ -201,12 +186,12 @@ pub fn gateway_for_benchmark(gateway_config: GatewayConfig) -> GatewayForBenchma
201186 mempool_client. expect_validate_tx ( ) . returning ( |_| Ok ( ( ) ) ) ;
202187 mempool_client. expect_account_tx_in_pool_or_recent_block ( ) . returning ( |_| Ok ( false ) ) ;
203188
204- GatewayForBenchmark ( GenericGateway :: new (
189+ GenericGateway :: new (
205190 gateway_config,
206191 Arc :: new ( state_reader_factory) ,
207192 Arc :: new ( mempool_client) ,
208193 Arc :: new ( transaction_converter) ,
209194 stateless_tx_validator,
210195 proof_archive_writer,
211- ) )
196+ )
212197}
0 commit comments