fn wait_for_state(&self, height: Height) {
        loop {
            let latest_state_height = self.state_manager.latest_state_height();
            if latest_state_height >= height {
                match self.state_manager.get_state_hash_at(height) {
                    Ok(hash) => {
                        println!("Latest checkpoint at height: {}", height);
                        println!("Latest state hash: {}", hex::encode(&hash.get().0));
                        break;
                    }
                    Err(StateHashError::Transient(err)) => {
                        println!("Transient state hash error: {:?}", err);
                    }
                    // This only happens for partially certified heights.
                    Err(StateHashError::Permanent(
                        PermanentStateHashError::StateNotFullyCertified(h),
                    )) if h == height => break,
                    Err(err) => {
                        panic!("State computation failed: {:?}", err)
                    }
                }
            }
            std::thread::sleep(WAIT_DURATION);
        }
        println!(
            "Latest state height is {}",
            self.state_manager.latest_state_height()
        );
        assert_eq!(
            height,
            self.state_manager.latest_state_height(),
            "Latest delivered batch is of height {} while the latest known state is at height {}",
            height,
            self.state_manager.latest_state_height()
        );
    }
// Blocks until the state at the given height is committed.
Blocks until the state at the given height is committed.
Blocks until the state at the given height is committed .
fn wait_for_state(&self, height: Height) {
        loop {
            let latest_state_height = self.state_manager.latest_state_height();
            if latest_state_height >= height {
                match self.state_manager.get_state_hash_at(height) {
                    Ok(hash) => {
                        println!("Latest checkpoint at height: {}", height);
                        println!("Latest state hash: {}", hex::encode(&hash.get().0));
                        break;
                    }
                    Err(StateHashError::Transient(err)) => {
                        println!("Transient state hash error: {:?}", err);
                    }
                    // This only happens for partially certified heights.
                    Err(StateHashError::Permanent(
                        PermanentStateHashError::StateNotFullyCertified(h),
                    )) if h == height => break,
                    Err(err) => {
                        panic!("State computation failed: {:?}", err)
                    }
                }
            }
            std::thread::sleep(WAIT_DURATION);
        }
        println!(
            "Latest state height is {}",
            self.state_manager.latest_state_height()
        );
        assert_eq!(
            height,
            self.state_manager.latest_state_height(),
            "Latest delivered batch is of height {} while the latest known state is at height {}",
            height,
            self.state_manager.latest_state_height()
        );
    }
fn wait_for_state ( & self , height : Height ) { loop { let latest_state_height = self . state_manager . latest_state_height ( ) ; if latest_state_height >= height { match self . state_manager . get_state_hash_at ( height ) { Ok ( hash ) => { println ! ( " " height ) ; println ! ( " " hex encode ( hash get ( ) 0 ) ) ; break ; } Err ( StateHashError :: Transient ( err ) ) => { println ! ( " " err ) ; } // This only happens for partially certified heights. Err ( StateHashError :: Permanent ( PermanentStateHashError :: StateNotFullyCertified ( h ) , ) ) if h == height => break , Err ( err ) => { panic ! ( " " err ) } } } std :: thread :: sleep ( WAIT_DURATION ) ; } println ! ( " " self state_manager latest_state_height ( ) ) ; assert_eq ! ( height self state_manager latest_state_height ( ) " " height self state_manager latest_state_height ( ) ) ; }
Blocks until the state at the given height is committed.
Blocks until the state at the given height is committed .
&self
height
Height
&self
height
Height