Obvious typo fix.

This commit is contained in:
Gav Wood 2016-03-11 13:21:53 +01:00
parent d71c5d4c17
commit 2a856a13f0
5 changed files with 16 additions and 16 deletions

View File

@ -171,7 +171,7 @@ pub struct SealedBlock {
impl<'x> OpenBlock<'x> {
/// Create a new OpenBlock ready for transaction pushing.
pub fn new(engine: &'x Engine, db: Box<Box<JournalDB>>, parent: &Header, last_hashes: LastHashes, author: Address, extra_data: Bytes) -> Self {
pub fn new(engine: &'x Engine, db: Box<JournalDB>, parent: &Header, last_hashes: LastHashes, author: Address, extra_data: Bytes) -> Self {
let mut r = OpenBlock {
block: ExecutedBlock::new(State::from_existing(db, parent.state_root().clone(), engine.account_start_nonce())),
engine: engine,
@ -317,7 +317,7 @@ impl ClosedBlock {
}
/// Drop this object and return the underlieing database.
pub fn drain(self) -> Box<Box<JournalDB>> { self.block.state.drop().1 }
pub fn drain(self) -> Box<JournalDB> { self.block.state.drop().1 }
}
impl SealedBlock {
@ -331,7 +331,7 @@ impl SealedBlock {
}
/// Drop this object and return the underlieing database.
pub fn drain(self) -> Box<Box<JournalDB>> { self.block.state.drop().1 }
pub fn drain(self) -> Box<JournalDB> { self.block.state.drop().1 }
}
impl IsBlock for SealedBlock {
@ -339,7 +339,7 @@ impl IsBlock for SealedBlock {
}
/// Enact the block given by block header, transactions and uncles
pub fn enact(header: &Header, transactions: &[SignedTransaction], uncles: &[Header], engine: &Engine, db: Box<Box<JournalDB>>, parent: &Header, last_hashes: LastHashes) -> Result<ClosedBlock, Error> {
pub fn enact(header: &Header, transactions: &[SignedTransaction], uncles: &[Header], engine: &Engine, db: Box<JournalDB>, parent: &Header, last_hashes: LastHashes) -> Result<ClosedBlock, Error> {
{
if ::log::max_log_level() >= ::log::LogLevel::Trace {
let s = State::from_existing(db.spawn(), parent.state_root().clone(), engine.account_start_nonce());
@ -357,20 +357,20 @@ pub fn enact(header: &Header, transactions: &[SignedTransaction], uncles: &[Head
}
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header
pub fn enact_bytes(block_bytes: &[u8], engine: &Engine, db: Box<Box<JournalDB>>, parent: &Header, last_hashes: LastHashes) -> Result<ClosedBlock, Error> {
pub fn enact_bytes(block_bytes: &[u8], engine: &Engine, db: Box<JournalDB>, parent: &Header, last_hashes: LastHashes) -> Result<ClosedBlock, Error> {
let block = BlockView::new(block_bytes);
let header = block.header();
enact(&header, &block.transactions(), &block.uncles(), engine, db, parent, last_hashes)
}
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header
pub fn enact_verified(block: &PreverifiedBlock, engine: &Engine, db: Box<Box<JournalDB>>, parent: &Header, last_hashes: LastHashes) -> Result<ClosedBlock, Error> {
pub fn enact_verified(block: &PreverifiedBlock, engine: &Engine, db: Box<JournalDB>, parent: &Header, last_hashes: LastHashes) -> Result<ClosedBlock, Error> {
let view = BlockView::new(&block.bytes);
enact(&block.header, &block.transactions, &view.uncles(), engine, db, parent, last_hashes)
}
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header. Seal the block aferwards
pub fn enact_and_seal(block_bytes: &[u8], engine: &Engine, db: Box<Box<JournalDB>>, parent: &Header, last_hashes: LastHashes) -> Result<SealedBlock, Error> {
pub fn enact_and_seal(block_bytes: &[u8], engine: &Engine, db: Box<JournalDB>, parent: &Header, last_hashes: LastHashes) -> Result<SealedBlock, Error> {
let header = BlockView::new(block_bytes).header_view();
Ok(try!(try!(enact_bytes(block_bytes, engine, db, parent, last_hashes)).seal(engine, header.seal())))
}

View File

@ -101,7 +101,7 @@ impl ClientReport {
pub struct Client<V = CanonVerifier> where V: Verifier {
chain: Arc<BlockChain>,
engine: Arc<Box<Engine>>,
state_db: Mutex<Box<Box<JournalDB>>>,
state_db: Mutex<Box<JournalDB>>,
block_queue: BlockQueue,
report: RwLock<ClientReport>,
import_lock: Mutex<()>,

View File

@ -31,7 +31,7 @@ pub type ApplyResult = Result<Receipt, Error>;
/// Representation of the entire state of all accounts in the system.
pub struct State {
db: Box<Box<JournalDB>>,
db: Box<JournalDB>,
root: H256,
cache: RefCell<HashMap<Address, Option<Account>>>,
snapshots: RefCell<Vec<HashMap<Address, Option<Option<Account>>>>>,
@ -41,7 +41,7 @@ pub struct State {
impl State {
/// Creates new state with empty state root
#[cfg(test)]
pub fn new(mut db: Box<Box<JournalDB>>, account_start_nonce: U256) -> State {
pub fn new(mut db: Box<JournalDB>, account_start_nonce: U256) -> State {
let mut root = H256::new();
{
// init trie and reset root too null
@ -58,7 +58,7 @@ impl State {
}
/// Creates new state with existing state root
pub fn from_existing(db: Box<Box<JournalDB>>, root: H256, account_start_nonce: U256) -> State {
pub fn from_existing(db: Box<JournalDB>, root: H256, account_start_nonce: U256) -> State {
{
// trie should panic! if root does not exist
let _ = SecTrieDB::new(db.as_hashdb(), &root);
@ -126,7 +126,7 @@ impl State {
}
/// Destroy the current object and return root and database.
pub fn drop(self) -> (H256, Box<Box<JournalDB>>) {
pub fn drop(self) -> (H256, Box<JournalDB>) {
(self.root, self.db)
}

View File

@ -250,7 +250,7 @@ pub fn generate_dummy_empty_blockchain() -> GuardedTempResult<BlockChain> {
}
}
pub fn get_temp_journal_db() -> GuardedTempResult<Box<Box<JournalDB>>> {
pub fn get_temp_journal_db() -> GuardedTempResult<Box<JournalDB>> {
let temp = RandomTempPath::new();
let journal_db = Box::new(OptionOneDB::new(temp.as_str()));
GuardedTempResult {
@ -268,7 +268,7 @@ pub fn get_temp_state() -> GuardedTempResult<State> {
}
}
pub fn get_temp_journal_db_in(path: &Path) -> Box<Box<JournalDB>> {
pub fn get_temp_journal_db_in(path: &Path) -> Box<JournalDB> {
Box::new(OptionOneDB::new(path.to_str().unwrap()))
}

View File

@ -28,7 +28,7 @@ use std::env;
/// exclusive actions.
pub trait JournalDB : HashDB + Sync + Send {
/// Return a copy of ourself, in a box.
fn spawn(&self) -> Box<Box<JournalDB>>;
fn spawn(&self) -> Box<JournalDB>;
/// Returns heap memory size used
fn mem_used(&self) -> usize;
@ -418,7 +418,7 @@ impl HashDB for OptionOneDB {
}
impl JournalDB for OptionOneDB {
fn spawn(&self) -> Box<Box<JournalDB>> {
fn spawn(&self) -> Box<JournalDB> {
Box::new(OptionOneDB {
overlay: MemoryDB::new(),
backing: self.backing.clone(),