From ad86feb667c450ac19cf151a51d4850b2b020c83 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 28 Mar 2016 09:42:50 +0200 Subject: [PATCH] Rename spawn -> boxed_clone --- ethcore/src/client/client.rs | 6 +++--- util/src/journaldb/archivedb.rs | 2 +- util/src/journaldb/earlymergedb.rs | 2 +- util/src/journaldb/overlayrecentdb.rs | 2 +- util/src/journaldb/refcounteddb.rs | 2 +- util/src/journaldb/traits.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 05a3b45e1..ced426a0c 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -212,7 +212,7 @@ impl Client where V: Verifier { // Enact Verified Block let parent = chain_has_parent.unwrap(); let last_hashes = self.build_last_hashes(header.parent_hash.clone()); - let db = self.state_db.lock().unwrap().spawn(); + let db = self.state_db.lock().unwrap().boxed_clone(); let enact_result = enact_verified(&block, engine, self.chain.have_tracing(), db, &parent, last_hashes); if let Err(e) = enact_result { @@ -342,7 +342,7 @@ impl Client where V: Verifier { /// Get a copy of the best block's state. pub fn state(&self) -> State { - State::from_existing(self.state_db.lock().unwrap().spawn(), HeaderView::new(&self.best_block_header()).state_root(), self.engine.account_start_nonce()) + State::from_existing(self.state_db.lock().unwrap().boxed_clone(), HeaderView::new(&self.best_block_header()).state_root(), self.engine.account_start_nonce()) } /// Get info on the cache. @@ -440,7 +440,7 @@ impl BlockChainClient for Client where V: Verifier { let mut b = OpenBlock::new( engine, false, // TODO: this will need to be parameterised once we want to do immediate mining insertion. - self.state_db.lock().unwrap().spawn(), + self.state_db.lock().unwrap().boxed_clone(), match self.chain.block_header(&h) { Some(ref x) => x, None => { return (None, invalid_transactions) } }, self.build_last_hashes(h.clone()), author, diff --git a/util/src/journaldb/archivedb.rs b/util/src/journaldb/archivedb.rs index 82d8a00ba..9a0ac5e43 100644 --- a/util/src/journaldb/archivedb.rs +++ b/util/src/journaldb/archivedb.rs @@ -128,7 +128,7 @@ impl HashDB for ArchiveDB { } impl JournalDB for ArchiveDB { - fn spawn(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(ArchiveDB { overlay: self.overlay.clone(), backing: self.backing.clone(), diff --git a/util/src/journaldb/earlymergedb.rs b/util/src/journaldb/earlymergedb.rs index 3e5252404..6279d6f40 100644 --- a/util/src/journaldb/earlymergedb.rs +++ b/util/src/journaldb/earlymergedb.rs @@ -320,7 +320,7 @@ impl HashDB for EarlyMergeDB { } impl JournalDB for EarlyMergeDB { - fn spawn(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(EarlyMergeDB { overlay: self.overlay.clone(), backing: self.backing.clone(), diff --git a/util/src/journaldb/overlayrecentdb.rs b/util/src/journaldb/overlayrecentdb.rs index 236d1f177..31b68f802 100644 --- a/util/src/journaldb/overlayrecentdb.rs +++ b/util/src/journaldb/overlayrecentdb.rs @@ -197,7 +197,7 @@ impl OverlayRecentDB { } impl JournalDB for OverlayRecentDB { - fn spawn(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(self.clone()) } diff --git a/util/src/journaldb/refcounteddb.rs b/util/src/journaldb/refcounteddb.rs index a8c3ff12b..20e1efb3f 100644 --- a/util/src/journaldb/refcounteddb.rs +++ b/util/src/journaldb/refcounteddb.rs @@ -94,7 +94,7 @@ impl HashDB for RefCountedDB { } impl JournalDB for RefCountedDB { - fn spawn(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(RefCountedDB { forward: self.forward.clone(), backing: self.backing.clone(), diff --git a/util/src/journaldb/traits.rs b/util/src/journaldb/traits.rs index 017c24330..afc6ab89a 100644 --- a/util/src/journaldb/traits.rs +++ b/util/src/journaldb/traits.rs @@ -23,7 +23,7 @@ use hashdb::*; /// exclusive actions. pub trait JournalDB : HashDB + Send + Sync { /// Return a copy of ourself, in a box. - fn spawn(&self) -> Box; + fn boxed_clone(&self) -> Box; /// Returns heap memory size used fn mem_used(&self) -> usize;