Split IO and network crates (#1828)

* Abort on panic

* Split IO and network crates

* Restore panic handler

* Fixed doc tests
This commit is contained in:
Arkadiy Paronyan
2016-08-05 10:32:04 +02:00
committed by Marek Kotewicz
parent 08f30fc1a8
commit 05bfdc508e
66 changed files with 464 additions and 344 deletions

View File

@@ -15,9 +15,10 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use util::*;
use network::*;
use ethcore::client::{TestBlockChainClient, BlockChainClient};
use ethcore::header::BlockNumber;
use io::SyncIo;
use sync_io::SyncIo;
use chain::ChainSync;
use ::SyncConfig;
@@ -48,7 +49,7 @@ impl<'p> SyncIo for TestIo<'p> {
false
}
fn respond(&mut self, packet_id: PacketId, data: Vec<u8>) -> Result<(), UtilError> {
fn respond(&mut self, packet_id: PacketId, data: Vec<u8>) -> Result<(), NetworkError> {
self.queue.push_back(TestPacket {
data: data,
packet_id: packet_id,
@@ -57,7 +58,7 @@ impl<'p> SyncIo for TestIo<'p> {
Ok(())
}
fn send(&mut self, peer_id: PeerId, packet_id: PacketId, data: Vec<u8>) -> Result<(), UtilError> {
fn send(&mut self, peer_id: PeerId, packet_id: PacketId, data: Vec<u8>) -> Result<(), NetworkError> {
self.queue.push_back(TestPacket {
data: data,
packet_id: packet_id,