applied client interface changes to sync tests

This commit is contained in:
debris
2016-02-10 22:16:25 +01:00
parent 484a4d8bdd
commit df0fa06e8a
5 changed files with 32 additions and 48 deletions

View File

@@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use util::*;
use ethcore::client::{BlockChainClient};
use ethcore::client::{BlockChainClient, BlockId};
use io::SyncIo;
use chain::{SyncState};
use super::helpers::*;
@@ -27,7 +27,7 @@ fn two_peers() {
net.peer_mut(1).chain.add_blocks(1000, false);
net.peer_mut(2).chain.add_blocks(1000, false);
net.sync();
assert!(net.peer(0).chain.block_at(1000).is_some());
assert!(net.peer(0).chain.block(BlockId::Number(1000)).is_some());
assert_eq!(net.peer(0).chain.blocks.read().unwrap().deref(), net.peer(1).chain.blocks.read().unwrap().deref());
}
@@ -60,7 +60,7 @@ fn empty_blocks() {
net.peer_mut(2).chain.add_blocks(5, n % 2 == 0);
}
net.sync();
assert!(net.peer(0).chain.block_at(1000).is_some());
assert!(net.peer(0).chain.block(BlockId::Number(1000)).is_some());
assert_eq!(net.peer(0).chain.blocks.read().unwrap().deref(), net.peer(1).chain.blocks.read().unwrap().deref());
}
@@ -148,4 +148,4 @@ fn propagade_blocks() {
assert!(!net.peer(0).queue.is_empty());
// NEW_BLOCK_PACKET
assert_eq!(0x07, net.peer(0).queue[0].packet_id);
}
}