Make *ID names consistent with std Rust (Id)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use io::IoChannel;
|
||||
use client::{BlockChainClient, MiningBlockChainClient, Client, ClientConfig, BlockID};
|
||||
use client::{BlockChainClient, MiningBlockChainClient, Client, ClientConfig, BlockId};
|
||||
use state::CleanupMode;
|
||||
use ethereum;
|
||||
use block::IsBlock;
|
||||
@@ -99,7 +99,7 @@ fn imports_good_block() {
|
||||
client.flush_queue();
|
||||
client.import_verified_blocks();
|
||||
|
||||
let block = client.block_header(BlockID::Number(1)).unwrap();
|
||||
let block = client.block_header(BlockId::Number(1)).unwrap();
|
||||
assert!(!block.is_empty());
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ fn query_none_block() {
|
||||
IoChannel::disconnected(),
|
||||
&db_config
|
||||
).unwrap();
|
||||
let non_existant = client.block_header(BlockID::Number(188));
|
||||
let non_existant = client.block_header(BlockId::Number(188));
|
||||
assert!(non_existant.is_none());
|
||||
}
|
||||
|
||||
@@ -125,7 +125,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());
|
||||
}
|
||||
@@ -146,8 +146,8 @@ fn returns_logs() {
|
||||
let client_result = get_test_client_with_blocks(vec![dummy_block.clone()]);
|
||||
let client = client_result.reference();
|
||||
let logs = client.logs(Filter {
|
||||
from_block: BlockID::Earliest,
|
||||
to_block: BlockID::Latest,
|
||||
from_block: BlockId::Earliest,
|
||||
to_block: BlockId::Latest,
|
||||
address: None,
|
||||
topics: vec![],
|
||||
limit: None,
|
||||
@@ -161,8 +161,8 @@ fn returns_logs_with_limit() {
|
||||
let client_result = get_test_client_with_blocks(vec![dummy_block.clone()]);
|
||||
let client = client_result.reference();
|
||||
let logs = client.logs(Filter {
|
||||
from_block: BlockID::Earliest,
|
||||
to_block: BlockID::Latest,
|
||||
from_block: BlockId::Earliest,
|
||||
to_block: BlockId::Latest,
|
||||
address: None,
|
||||
topics: vec![],
|
||||
limit: Some(2),
|
||||
@@ -176,7 +176,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()[..]);
|
||||
@@ -187,7 +187,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());
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use nanoipc;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{Ordering, AtomicBool};
|
||||
use client::{Client, BlockChainClient, ClientConfig, BlockID};
|
||||
use client::{Client, BlockChainClient, ClientConfig, BlockId};
|
||||
use client::remote::RemoteClient;
|
||||
use tests::helpers::*;
|
||||
use devtools::*;
|
||||
@@ -71,7 +71,7 @@ fn can_query_block() {
|
||||
run_test_worker(scope, stop_guard.share(), socket_path);
|
||||
let remote_client = nanoipc::generic_client::<RemoteClient<_>>(socket_path).unwrap();
|
||||
|
||||
let non_existant_block = remote_client.block_header(BlockID::Number(999));
|
||||
let non_existant_block = remote_client.block_header(BlockId::Number(999));
|
||||
|
||||
assert!(non_existant_block.is_none());
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user