Make Id/ID and db/Db/DB usage consistent

This commit is contained in:
debris
2016-05-19 11:00:32 +02:00
parent 7d873b2c81
commit 634679966e
17 changed files with 156 additions and 156 deletions

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use client::{BlockChainClient, Client, ClientConfig, BlockId};
use client::{BlockChainClient, Client, ClientConfig, BlockID};
use block::IsBlock;
use tests::helpers::*;
use common::*;
@@ -49,7 +49,7 @@ fn imports_good_block() {
client.flush_queue();
client.import_verified_blocks(&IoChannel::disconnected());
let block = client.block_header(BlockId::Number(1)).unwrap();
let block = client.block_header(BlockID::Number(1)).unwrap();
assert!(!block.is_empty());
}
@@ -58,7 +58,7 @@ fn query_none_block() {
let dir = RandomTempPath::new();
let client = Client::new(ClientConfig::default(), get_test_spec(), dir.as_path(), IoChannel::disconnected());
let non_existant = client.block_header(BlockId::Number(188));
let non_existant = client.block_header(BlockID::Number(188));
assert!(non_existant.is_none());
}
@@ -66,7 +66,7 @@ fn query_none_block() {
fn query_bad_block() {
let client_result = get_test_client_with_blocks(vec![get_bad_state_dummy_block()]);
let client = client_result.reference();
let bad_block:Option<Bytes> = client.block_header(BlockId::Number(1));
let bad_block:Option<Bytes> = client.block_header(BlockID::Number(1));
assert!(bad_block.is_none());
}
@@ -87,7 +87,7 @@ fn returns_block_body() {
let client_result = get_test_client_with_blocks(vec![dummy_block.clone()]);
let client = client_result.reference();
let block = BlockView::new(&dummy_block);
let body = client.block_body(BlockId::Hash(block.header().hash())).unwrap();
let body = client.block_body(BlockID::Hash(block.header().hash())).unwrap();
let body = Rlp::new(&body);
assert_eq!(body.item_count(), 2);
assert_eq!(body.at(0).as_raw()[..], block.rlp().at(1).as_raw()[..]);
@@ -98,7 +98,7 @@ fn returns_block_body() {
fn imports_block_sequence() {
let client_result = generate_dummy_client(6);
let client = client_result.reference();
let block = client.block_header(BlockId::Number(5)).unwrap();
let block = client.block_header(BlockID::Number(5)).unwrap();
assert!(!block.is_empty());
}