pub fn new(ctx: &ScenarioContext, rpc_client: RpcClient) -> Self {
        // Load the config for the test from JSON file.
        let config = RealLifeConfig::load(&ctx.config_path);

        // Generate random accounts to rotate funds within.
        let accounts = (0..config.n_accounts)
            .map(|_| ZksyncAccount::rand())
            .collect();

        // Create a transport for Ethereum account.
        let (_event_loop_handle, transport) =
            Http::new(&ctx.options.web3_url).expect("http transport start");

        // Create main account to deposit money from and to return money back later.
        let main_account = TestAccount::from_info(&config.input_account, &transport, &ctx.options);

        // Load additional accounts for the satellite scenario.
        let additional_accounts: Vec<_> = config
            .additional_accounts
            .iter()
            .map(|acc| TestAccount::from_info(acc, &transport, &ctx.options))
            .collect();

        let block_sizes = Self::get_block_sizes(config.use_all_block_sizes);

        if config.use_all_block_sizes {
            log::info!(
                "Following block sizes will be used in test: {:?}",
                block_sizes
            );
        }

        let transfer_size = closest_packable_token_amount(&BigUint::from(config.transfer_size));
        let verify_timeout = Duration::from_secs(config.block_timeout);

        let satellite_scenario = Some(SatelliteScenario::new(
            rpc_client.clone(),
            additional_accounts,
            transfer_size.clone(),
            verify_timeout,
        ));

        Self {
            rpc_client,

            main_account,
            accounts,

            n_accounts: config.n_accounts,
            transfer_size,
            cycles_amount: config.cycles_amount,

            block_sizes,

            verify_timeout,

            estimated_fee_for_op: 0u32.into(),

            satellite_scenario,

            _event_loop_handle,
        }
    }
/// Creates a real-life scenario executor.
Creates a real-life scenario executor.
Creates a real - life scenario executor .
pub fn new(ctx: &ScenarioContext, rpc_client: RpcClient) -> Self {
        // Load the config for the test from JSON file.
        let config = RealLifeConfig::load(&ctx.config_path);
        // Generate random accounts to rotate funds within.
        let accounts = (0..config.n_accounts)
            .map(|_| ZksyncAccount::rand())
            .collect();
        // Create a transport for Ethereum account.
        let (_event_loop_handle, transport) =
            Http::new(&ctx.options.web3_url).expect("http transport start");
        // Create main account to deposit money from and to return money back later.
        let main_account = TestAccount::from_info(&config.input_account, &transport, &ctx.options);
        // Load additional accounts for the satellite scenario.
        let additional_accounts: Vec<_> = config
            .additional_accounts
            .iter()
            .map(|acc| TestAccount::from_info(acc, &transport, &ctx.options))
            .collect();
        let block_sizes = Self::get_block_sizes(config.use_all_block_sizes);
        if config.use_all_block_sizes {
            log::info!(
                "Following block sizes will be used in test: {:?}",
                block_sizes
            );
        }
        let transfer_size = closest_packable_token_amount(&BigUint::from(config.transfer_size));
        let verify_timeout = Duration::from_secs(config.block_timeout);
        let satellite_scenario = Some(SatelliteScenario::new(
            rpc_client.clone(),
            additional_accounts,
            transfer_size.clone(),
            verify_timeout,
        ));
        Self {
            rpc_client,
            main_account,
            accounts,
            n_accounts: config.n_accounts,
            transfer_size,
            cycles_amount: config.cycles_amount,
            block_sizes,
            verify_timeout,
            estimated_fee_for_op: 0u32.into(),
            satellite_scenario,
            _event_loop_handle,
        }
    }
pub fn new ( ctx : & ScenarioContext , rpc_client : RpcClient ) -> Self { // Load the config for the test from JSON file. let config = RealLifeConfig :: load ( & ctx . config_path ) ; // Generate random accounts to rotate funds within. let accounts = ( 0 .. config . n_accounts ) . map ( | _ | ZksyncAccount :: rand ( ) ) . collect ( ) ; // Create a transport for Ethereum account. let ( _event_loop_handle , transport ) = Http :: new ( & ctx . options . web3_url ) . expect ( " " ) ; // Create main account to deposit money from and to return money back later. let main_account = TestAccount :: from_info ( & config . input_account , & transport , & ctx . options ) ; // Load additional accounts for the satellite scenario. let additional_accounts : Vec < _ > = config . additional_accounts . iter ( ) . map ( | acc | TestAccount :: from_info ( acc , & transport , & ctx . options ) ) . collect ( ) ; let block_sizes = Self :: get_block_sizes ( config . use_all_block_sizes ) ; if config . use_all_block_sizes { log :: info ! ( " " block_sizes ) ; } let transfer_size = closest_packable_token_amount ( & BigUint :: from ( config . transfer_size ) ) ; let verify_timeout = Duration :: from_secs ( config . block_timeout ) ; let satellite_scenario = Some ( SatelliteScenario :: new ( rpc_client . clone ( ) , additional_accounts , transfer_size . clone ( ) , verify_timeout , ) ) ; Self { rpc_client , main_account , accounts , n_accounts : config . n_accounts , transfer_size , cycles_amount : config . cycles_amount , block_sizes , verify_timeout , estimated_fee_for_op : 0u32 . into ( ) , satellite_scenario , _event_loop_handle , } }
Creates a real-life scenario executor.
Creates a real - life scenario executor .
ctx
&ScenarioContext
rpc_client
RpcClient