pub fn save_events_state(
    connection_pool: &ConnectionPool,
    block_events: &[BlockEvent],
    tokens: &[NewTokenEvent],
    last_watched_eth_block_number: u64,
) {
    let storage = connection_pool.access_storage().expect("db failed");

    let mut new_events: Vec<NewBlockEvent> = vec![];
    for event in block_events {
        new_events.push(block_event_into_stored_block_event(event));
    }

    let block_number = NewLastWatchedEthBlockNumber {
        block_number: last_watched_eth_block_number.to_string(),
    };

    storage
        .data_restore_schema()
        .save_events_state(new_events.as_slice(), tokens, &block_number)
        .expect("Cant update events state");
}
/// Saves Rollup contract events in storage (includes block events, new tokens and last watched eth block number)
///
/// # Arguments
///
/// * `connection_pool` - Database Connection Pool
/// * `eveblock_eventsnts` - Rollup contract block events descriptions
/// * `tokens` - Tokens that had been added to system
/// * `last_watched_eth_block_number` - Last watched ethereum block
///
Saves Rollup contract events in storage (includes block events, new tokens and last watched eth block number)
Saves Rollup contract events in storage ( includes block events new tokens and last watched eth block number )
pub fn save_events_state(
    connection_pool: &ConnectionPool,
    block_events: &[BlockEvent],
    tokens: &[NewTokenEvent],
    last_watched_eth_block_number: u64,
) {
    let storage = connection_pool.access_storage().expect("db failed");
    let mut new_events: Vec<NewBlockEvent> = vec![];
    for event in block_events {
        new_events.push(block_event_into_stored_block_event(event));
    }
    let block_number = NewLastWatchedEthBlockNumber {
        block_number: last_watched_eth_block_number.to_string(),
    };
    storage
        .data_restore_schema()
        .save_events_state(new_events.as_slice(), tokens, &block_number)
        .expect("Cant update events state");
}
pub fn save_events_state ( connection_pool : & ConnectionPool , block_events : & [ BlockEvent ] , tokens : & [ NewTokenEvent ] , last_watched_eth_block_number : u64 , ) { let storage = connection_pool . access_storage ( ) . expect ( " " ) ; let mut new_events : Vec < NewBlockEvent > = vec ! [ ] ; for event in block_events { new_events . push ( block_event_into_stored_block_event ( event ) ) ; } let block_number = NewLastWatchedEthBlockNumber { block_number : last_watched_eth_block_number . to_string ( ) , } ; storage . data_restore_schema ( ) . save_events_state ( new_events . as_slice ( ) , tokens , & block_number ) . expect ( " " ) ; }
Saves Rollup contract events in storage (includes block events, new tokens and last watched eth block number)
Saves Rollup contract events in storage ( includes block events new tokens and last watched eth block number )
connection_pool
&ConnectionPool
block_events
&[BlockEvent]
tokens
&[NewTokenEvent]
last_watched_eth_block_number
u64