pub fn empty(
        environment: Arc<LmdbEnvironment>,
        trie_store: Arc<LmdbTrieStore>,
    ) -> Result<Self, error::Error> {
        let root_hash: Digest = {
            let (root_hash, root) = create_hashed_empty_trie::<Key, StoredValue>()?;
            let mut txn = environment.create_read_write_txn()?;
            trie_store.put(&mut txn, &root_hash, &root)?;
            txn.commit()?;
            environment.env().sync(true)?;
            root_hash
        };
        Ok(LmdbGlobalState::new(environment, trie_store, root_hash))
    }
/// Creates an empty state from an existing environment and trie_store.
Creates an empty state from an existing environment and trie_store.
Creates an empty state from an existing environment and trie_store .
pub fn empty(
        environment: Arc<LmdbEnvironment>,
        trie_store: Arc<LmdbTrieStore>,
    ) -> Result<Self, error::Error> {
        let root_hash: Digest = {
            let (root_hash, root) = create_hashed_empty_trie::<Key, StoredValue>()?;
            let mut txn = environment.create_read_write_txn()?;
            trie_store.put(&mut txn, &root_hash, &root)?;
            txn.commit()?;
            environment.env().sync(true)?;
            root_hash
        };
        Ok(LmdbGlobalState::new(environment, trie_store, root_hash))
    }
pub fn empty ( environment : Arc < LmdbEnvironment > , trie_store : Arc < LmdbTrieStore > , ) -> Result < Self , error :: Error > { let root_hash : Digest = { let ( root_hash , root ) = create_hashed_empty_trie :: < Key , StoredValue > ( ) ? ; let mut txn = environment . create_read_write_txn ( ) ? ; trie_store . put ( & mut txn , & root_hash , & root ) ? ; txn . commit ( ) ? ; environment . env ( ) . sync ( true ) ? ; root_hash } ; Ok ( LmdbGlobalState :: new ( environment , trie_store , root_hash ) ) }
Creates an empty state from an existing environment and trie_store.
Creates an empty state from an existing environment and trie_store .
environment
Arc<LmdbEnvironment>
trie_store
Arc<LmdbTrieStore>
environment
Arc<LmdbEnvironment>
trie_store
Arc<LmdbTrieStore>