From ffd10d337361a1960c3e24505f1e215e86e0a74d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 17 Dec 2015 21:12:35 +0100 Subject: [PATCH] Broken build --- src/account.rs | 2 +- src/state.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/account.rs b/src/account.rs index 95f58ed3b..b64b8ee93 100644 --- a/src/account.rs +++ b/src/account.rs @@ -96,7 +96,7 @@ impl Account { _ => {} } // fetch - cannot be done in match because of the borrow rules. - let t = TrieDBMut::new_existing(db, &mut self.storage_root); + let t = TrieDB::new(db, &self.storage_root); let r = H256::from_slice(t.get(key.bytes()).unwrap_or(&[0u8;32][..])); self.storage_overlay.insert(key, r.clone()); r diff --git a/src/state.rs b/src/state.rs index 978b55fbf..90d38abe8 100644 --- a/src/state.rs +++ b/src/state.rs @@ -61,7 +61,7 @@ impl State { pub fn new_existing(mut db: OverlayDB, mut root: H256, account_start_nonce: U256) -> State { { // trie should panic! if root does not exist - let _ = TrieDBMut::new_existing(&mut db, &mut root); + let _ = TrieDB::new(&mut db, &mut root); } State { @@ -164,8 +164,7 @@ impl State { fn get(&mut self, a: &Address, require_code: bool) -> Option<&Account> { if self.cache.get(a).is_none() { // load from trie. - let t = TrieDBMut::new_existing(&mut self.db, &mut self.root); - self.cache.insert(a.clone(), t.get(&a).map(|rlp| { println!("RLP: {:?}", rlp); Account::from_rlp(rlp) })); + self.cache.insert(a.clone(), TrieDB::new(&self.db, &self.root).get(&a).map(|rlp| Account::from_rlp(rlp))); } let db = &self.db; @@ -182,7 +181,7 @@ impl State { fn require(&mut self, a: &Address, require_code: bool) -> &mut Account { if self.cache.get(a).is_none() { // load from trie. - self.cache.insert(a.clone(), TrieDBMut::new(&mut self.db, &mut self.root).get(&a).map(|rlp| Account::from_rlp(rlp))); + self.cache.insert(a.clone(), TrieDB::new(&self.db, &self.root).get(&a).map(|rlp| Account::from_rlp(rlp))); } if self.cache.get(a).unwrap().is_none() {