pub fn update_events_state<T: Transport>(
        &mut self,
        web3: &Web3<T>,
        franklin_contract: &(ethabi::Contract, Contract<T>),
        governance_contract: &(ethabi::Contract, Contract<T>),
        eth_blocks_step: u64,
        end_eth_blocks_offset: u64,
    ) -> Result<(Vec<BlockEvent>, Vec<NewTokenEvent>, u64), failure::Error> {
        self.remove_verified_events();

        let (block_events, token_events, to_block_number): (Vec<Log>, Vec<NewTokenEvent>, u64) =
            EventsState::get_new_events_and_last_watched_block(
                web3,
                franklin_contract,
                governance_contract,
                self.last_watched_eth_block_number,
                eth_blocks_step,
                end_eth_blocks_offset,
            )?;

        self.last_watched_eth_block_number = to_block_number;

        if !self.update_blocks_state(franklin_contract, &block_events) {
            return Ok((vec![], token_events, self.last_watched_eth_block_number));
        }

        let mut events_to_return: Vec<BlockEvent> = self.committed_events.clone();
        events_to_return.extend(self.verified_events.clone());

        Ok((
            events_to_return,
            token_events,
            self.last_watched_eth_block_number,
        ))
    }
/// Update past events state from last watched ethereum block with delta between last eth block and last watched block.
/// Returns new verified committed blocks evens, added tokens events and the last watched eth block number
///
/// # Arguments
///
/// * `web3` - Web3 provider url
/// * `franklin_contract` - Rollup contract
/// * `governance_contract` - Governance contract
/// * `eth_blocks_step` - Blocks step for watching
/// * `end_eth_blocks_offset` - Delta between last eth block and last watched block
///
Update past events state from last watched ethereum block with delta between last eth block and last watched block.
Returns new verified committed blocks evens, added tokens events and the last watched eth block number
Update past events state from last watched ethereum block with delta between last eth block and last watched block . Returns new verified committed blocks evens added tokens events and the last watched eth block number
pub fn update_events_state<T: Transport>(
        &mut self,
        web3: &Web3<T>,
        franklin_contract: &(ethabi::Contract, Contract<T>),
        governance_contract: &(ethabi::Contract, Contract<T>),
        eth_blocks_step: u64,
        end_eth_blocks_offset: u64,
    ) -> Result<(Vec<BlockEvent>, Vec<NewTokenEvent>, u64), failure::Error> {
        self.remove_verified_events();
        let (block_events, token_events, to_block_number): (Vec<Log>, Vec<NewTokenEvent>, u64) =
            EventsState::get_new_events_and_last_watched_block(
                web3,
                franklin_contract,
                governance_contract,
                self.last_watched_eth_block_number,
                eth_blocks_step,
                end_eth_blocks_offset,
            )?;
        self.last_watched_eth_block_number = to_block_number;
        if !self.update_blocks_state(franklin_contract, &block_events) {
            return Ok((vec![], token_events, self.last_watched_eth_block_number));
        }
        let mut events_to_return: Vec<BlockEvent> = self.committed_events.clone();
        events_to_return.extend(self.verified_events.clone());
        Ok((
            events_to_return,
            token_events,
            self.last_watched_eth_block_number,
        ))
    }
pub fn update_events_state < T : Transport > ( & mut self , web3 : & Web3 < T > , franklin_contract : & ( ethabi :: Contract , Contract < T > ) , governance_contract : & ( ethabi :: Contract , Contract < T > ) , eth_blocks_step : u64 , end_eth_blocks_offset : u64 , ) -> Result < ( Vec < BlockEvent > , Vec < NewTokenEvent > , u64 ) , failure :: Error > { self . remove_verified_events ( ) ; let ( block_events , token_events , to_block_number ) : ( Vec < Log > , Vec < NewTokenEvent > , u64 ) = EventsState :: get_new_events_and_last_watched_block ( web3 , franklin_contract , governance_contract , self . last_watched_eth_block_number , eth_blocks_step , end_eth_blocks_offset , ) ? ; self . last_watched_eth_block_number = to_block_number ; if ! self . update_blocks_state ( franklin_contract , & block_events ) { return Ok ( ( vec ! [ ] , token_events , self . last_watched_eth_block_number ) ) ; } let mut events_to_return : Vec < BlockEvent > = self . committed_events . clone ( ) ; events_to_return . extend ( self . verified_events . clone ( ) ) ; Ok ( ( events_to_return , token_events , self . last_watched_eth_block_number , ) ) }
Update past events state from last watched ethereum block with delta between last eth block and last watched block.
Update past events state from last watched ethereum block with delta between last eth block and last watched block .
&mut self
web3
&Web3<T>
franklin_contract
&(ethabi::Contract, Contract<T>)
governance_contract
&(ethabi::Contract, Contract<T>)
eth_blocks_step
u64
end_eth_blocks_offset
u64