fn build_eth_sender(
    max_txs_in_flight: u64,
    restore_state: impl IntoIterator<Item = ETHOperation>,
    stats: ETHStats,
) -> (
    ETHSender<MockEthereum, MockDatabase>,
    mpsc::Sender<ETHSenderRequest>,
    mpsc::Receiver<Operation>,
) {
    let ethereum = MockEthereum::default();
    let db = MockDatabase::with_restorable_state(restore_state, stats);

    let (operation_sender, operation_receiver) = mpsc::channel(CHANNEL_CAPACITY);
    let (notify_sender, notify_receiver) = mpsc::channel(CHANNEL_CAPACITY);

    let options = EthSenderOptions {
        max_txs_in_flight,
        expected_wait_time_block: super::EXPECTED_WAIT_TIME_BLOCKS,
        wait_confirmations: super::WAIT_CONFIRMATIONS,
        tx_poll_period: Default::default(),
        is_enabled: true,
    };

    let current_zksync_info = CurrentZksyncInfo::with_block_number(0);
    let eth_sender = ETHSender::new(
        options,
        db,
        ethereum,
        operation_receiver,
        notify_sender,
        current_zksync_info,
    );

    (eth_sender, operation_sender, notify_receiver)
}
/// Helper method for configurable creation of `ETHSender`.
Helper method for configurable creation of `ETHSender`.
Helper method for configurable creation of ` ETHSender ` .
fn build_eth_sender(
    max_txs_in_flight: u64,
    restore_state: impl IntoIterator<Item = ETHOperation>,
    stats: ETHStats,
) -> (
    ETHSender<MockEthereum, MockDatabase>,
    mpsc::Sender<ETHSenderRequest>,
    mpsc::Receiver<Operation>,
) {
    let ethereum = MockEthereum::default();
    let db = MockDatabase::with_restorable_state(restore_state, stats);
    let (operation_sender, operation_receiver) = mpsc::channel(CHANNEL_CAPACITY);
    let (notify_sender, notify_receiver) = mpsc::channel(CHANNEL_CAPACITY);
    let options = EthSenderOptions {
        max_txs_in_flight,
        expected_wait_time_block: super::EXPECTED_WAIT_TIME_BLOCKS,
        wait_confirmations: super::WAIT_CONFIRMATIONS,
        tx_poll_period: Default::default(),
        is_enabled: true,
    };
    let current_zksync_info = CurrentZksyncInfo::with_block_number(0);
    let eth_sender = ETHSender::new(
        options,
        db,
        ethereum,
        operation_receiver,
        notify_sender,
        current_zksync_info,
    );
    (eth_sender, operation_sender, notify_receiver)
}
fn build_eth_sender ( max_txs_in_flight : u64 , restore_state : impl IntoIterator < Item = ETHOperation > , stats : ETHStats , ) -> ( ETHSender < MockEthereum , MockDatabase > , mpsc :: Sender < ETHSenderRequest > , mpsc :: Receiver < Operation > , ) { let ethereum = MockEthereum :: default ( ) ; let db = MockDatabase :: with_restorable_state ( restore_state , stats ) ; let ( operation_sender , operation_receiver ) = mpsc :: channel ( CHANNEL_CAPACITY ) ; let ( notify_sender , notify_receiver ) = mpsc :: channel ( CHANNEL_CAPACITY ) ; let options = EthSenderOptions { max_txs_in_flight , expected_wait_time_block : super :: EXPECTED_WAIT_TIME_BLOCKS , wait_confirmations : super :: WAIT_CONFIRMATIONS , tx_poll_period : Default :: default ( ) , is_enabled : true , } ; let current_zksync_info = CurrentZksyncInfo :: with_block_number ( 0 ) ; let eth_sender = ETHSender :: new ( options , db , ethereum , operation_receiver , notify_sender , current_zksync_info , ) ; ( eth_sender , operation_sender , notify_receiver ) }
Helper method for configurable creation of `ETHSender`.
Helper method for configurable creation of ` ETHSender ` .
max_txs_in_flight
u64
restore_state
impl IntoIterator<Item = ETHOperation>
stats
ETHStats