Rename spawn -> boxed_clone

This commit is contained in:
Gav Wood 2016-03-28 09:42:50 +02:00
parent d150529730
commit ad86feb667
6 changed files with 8 additions and 8 deletions

View File

@ -212,7 +212,7 @@ impl<V> Client<V> 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<V> Client<V> 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<V> BlockChainClient for Client<V> 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,

View File

@ -128,7 +128,7 @@ impl HashDB for ArchiveDB {
}
impl JournalDB for ArchiveDB {
fn spawn(&self) -> Box<JournalDB> {
fn boxed_clone(&self) -> Box<JournalDB> {
Box::new(ArchiveDB {
overlay: self.overlay.clone(),
backing: self.backing.clone(),

View File

@ -320,7 +320,7 @@ impl HashDB for EarlyMergeDB {
}
impl JournalDB for EarlyMergeDB {
fn spawn(&self) -> Box<JournalDB> {
fn boxed_clone(&self) -> Box<JournalDB> {
Box::new(EarlyMergeDB {
overlay: self.overlay.clone(),
backing: self.backing.clone(),

View File

@ -197,7 +197,7 @@ impl OverlayRecentDB {
}
impl JournalDB for OverlayRecentDB {
fn spawn(&self) -> Box<JournalDB> {
fn boxed_clone(&self) -> Box<JournalDB> {
Box::new(self.clone())
}

View File

@ -94,7 +94,7 @@ impl HashDB for RefCountedDB {
}
impl JournalDB for RefCountedDB {
fn spawn(&self) -> Box<JournalDB> {
fn boxed_clone(&self) -> Box<JournalDB> {
Box::new(RefCountedDB {
forward: self.forward.clone(),
backing: self.backing.clone(),

View File

@ -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<JournalDB>;
fn boxed_clone(&self) -> Box<JournalDB>;
/// Returns heap memory size used
fn mem_used(&self) -> usize;