applied client interface changes to sync tests
This commit is contained in:
@@ -859,7 +859,7 @@ mod tests {
|
||||
let transactions = bc.transactions(&b1_hash).unwrap();
|
||||
assert_eq!(transactions.len(), 7);
|
||||
for t in transactions {
|
||||
assert_eq!(bc.transaction(&t.hash()).unwrap(), t);
|
||||
assert_eq!(bc.transaction(&bc.transaction_address(&t.hash()).unwrap()).unwrap(), t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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};
|
||||
use client::{BlockChainClient, Client, BlockId};
|
||||
use tests::helpers::*;
|
||||
use common::*;
|
||||
|
||||
@@ -44,7 +44,7 @@ fn imports_good_block() {
|
||||
client.flush_queue();
|
||||
client.import_verified_blocks(&IoChannel::disconnected());
|
||||
|
||||
let block = client.block_header_at(1).unwrap();
|
||||
let block = client.block_header(BlockId::Number(1)).unwrap();
|
||||
assert!(!block.is_empty());
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ fn query_none_block() {
|
||||
let dir = RandomTempPath::new();
|
||||
let client = Client::new(get_test_spec(), dir.as_path(), IoChannel::disconnected()).unwrap();
|
||||
|
||||
let non_existant = client.block_header_at(188);
|
||||
let non_existant = client.block_header(BlockId::Number(188));
|
||||
assert!(non_existant.is_none());
|
||||
}
|
||||
|
||||
@@ -61,7 +61,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_at(1);
|
||||
let bad_block:Option<Bytes> = client.block_header(BlockId::Number(1));
|
||||
|
||||
assert!(bad_block.is_none());
|
||||
}
|
||||
@@ -80,7 +80,7 @@ fn returns_chain_info() {
|
||||
fn imports_block_sequence() {
|
||||
let client_result = generate_dummy_client(6);
|
||||
let client = client_result.reference();
|
||||
let block = client.block_header_at(5).unwrap();
|
||||
let block = client.block_header(BlockId::Number(5)).unwrap();
|
||||
|
||||
assert!(!block.is_empty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user