Merge branch 'master' into auth-bft

This commit is contained in:
keorn
2016-12-10 18:14:35 +01:00
53 changed files with 441 additions and 428 deletions

View File

@@ -18,7 +18,7 @@
use std::fmt;
use ids::BlockID;
use ids::BlockId;
use util::H256;
use util::trie::TrieError;
@@ -28,7 +28,7 @@ use rlp::DecoderError;
#[derive(Debug)]
pub enum Error {
/// Invalid starting block for snapshot.
InvalidStartingBlock(BlockID),
InvalidStartingBlock(BlockId),
/// Block not found.
BlockNotFound(H256),
/// Incomplete chain.

View File

@@ -27,7 +27,7 @@ use account_db::{AccountDB, AccountDBMut};
use blockchain::{BlockChain, BlockProvider};
use engines::Engine;
use header::Header;
use ids::BlockID;
use ids::BlockId;
use views::BlockView;
use util::{Bytes, Hashable, HashDB, DBValue, snappy, U256, Uint};
@@ -129,7 +129,7 @@ pub fn take_snapshot<W: SnapshotWriter + Send>(
p: &Progress
) -> Result<(), Error> {
let start_header = try!(chain.block_header(&block_at)
.ok_or(Error::InvalidStartingBlock(BlockID::Hash(block_at))));
.ok_or(Error::InvalidStartingBlock(BlockId::Hash(block_at))));
let state_root = start_header.state_root();
let number = start_header.number();

View File

@@ -30,7 +30,7 @@ use blockchain::BlockChain;
use client::{BlockChainClient, Client};
use engines::Engine;
use error::Error;
use ids::BlockID;
use ids::BlockId;
use service::ClientIoMessage;
use io::IoChannel;
@@ -354,7 +354,7 @@ impl Service {
let writer = try!(LooseWriter::new(temp_dir.clone()));
let guard = Guard::new(temp_dir.clone());
let res = client.take_snapshot(writer, BlockID::Number(num), &self.progress);
let res = client.take_snapshot(writer, BlockId::Number(num), &self.progress);
self.taking_snapshot.store(false, Ordering::SeqCst);
if let Err(e) = res {

View File

@@ -19,7 +19,7 @@
use std::sync::Arc;
use client::{BlockChainClient, Client};
use ids::BlockID;
use ids::BlockId;
use snapshot::service::{Service, ServiceParams};
use snapshot::{self, ManifestData, SnapshotService};
use spec::Spec;
@@ -96,8 +96,8 @@ fn restored_is_equivalent() {
assert_eq!(service.status(), ::snapshot::RestorationStatus::Inactive);
for x in 0..NUM_BLOCKS {
let block1 = client.block(BlockID::Number(x as u64)).unwrap();
let block2 = client2.block(BlockID::Number(x as u64)).unwrap();
let block1 = client.block(BlockId::Number(x as u64)).unwrap();
let block2 = client2.block(BlockId::Number(x as u64)).unwrap();
assert_eq!(block1, block2);
}

View File

@@ -18,7 +18,7 @@
use util::Mutex;
use client::{BlockChainClient, Client, ChainNotify};
use ids::BlockID;
use ids::BlockId;
use service::ClientIoMessage;
use views::HeaderView;
@@ -43,7 +43,7 @@ impl<F> Oracle for StandardOracle<F>
where F: Send + Sync + Fn() -> bool
{
fn to_number(&self, hash: H256) -> Option<u64> {
self.client.block_header(BlockID::Hash(hash)).map(|h| HeaderView::new(&h).number())
self.client.block_header(BlockId::Hash(hash)).map(|h| HeaderView::new(&h).number())
}
fn is_major_importing(&self) -> bool {