/// Blocks until the hash of the latest state is computed.
///
/// # Panics
///
/// This function panics if the state hash computation takes more than a few
/// seconds to complete.
Blocks until the hash of the latest state is computed.
Blocks until the hash of the latest state is computed .
pub fn await_state_hash(&self) -> CryptoHashOfState {
        let h = self.state_manager.latest_state_height();
        let mut tries = 0;
        while tries < 100 {
            match self.state_manager.get_state_hash_at(h) {
                Ok(hash) => return hash,
                Err(StateHashError::Transient(_)) => {
                    tries += 1;
                    std::thread::sleep(Duration::from_millis(100));
                    continue;
                }
                Err(e @ StateHashError::Permanent(_)) => {
                    panic!("Failed to compute state hash: {}", e)
                }
            }
        }
        panic!("State hash computation took too long")
    }
pub fn await_state_hash ( & self ) -> CryptoHashOfState { let h = self . state_manager . latest_state_height ( ) ; let mut tries = 0 ; while tries < 100 { match self . state_manager . get_state_hash_at ( h ) { Ok ( hash ) => return hash , Err ( StateHashError :: Transient ( _ ) ) => { tries += 1 ; std :: thread :: sleep ( Duration :: from_millis ( 100 ) ) ; continue ; } Err ( e @ StateHashError :: Permanent ( _ ) ) => { panic ! ( " " e ) } } } panic ! ( " " ) }
Blocks until the hash of the latest state is computed.
Blocks until the hash of the latest state is computed .
&self
panics
This function panics if the state hash computation takes more than a few
seconds to complete.
This function panics if the state hash computation takes more than a few seconds to complete .