get on_demand tests to compile

This commit is contained in:
Robert Habermeier 2017-03-16 20:33:45 +01:00
parent 04f106aad8
commit b5527415d6
2 changed files with 5 additions and 8 deletions

View File

@ -536,7 +536,7 @@ mod tests {
use cache::Cache; use cache::Cache;
use net::{Announcement, BasicContext, ReqId, Error as LesError}; use net::{Announcement, BasicContext, ReqId, Error as LesError};
use request::{Request as LesRequest, Kind as LesRequestKind}; use request::Requests;
use network::{PeerId, NodeId}; use network::{PeerId, NodeId};
use time::Duration; use time::Duration;
@ -546,11 +546,10 @@ mod tests {
impl BasicContext for FakeContext { impl BasicContext for FakeContext {
fn persistent_peer_id(&self, _: PeerId) -> Option<NodeId> { None } fn persistent_peer_id(&self, _: PeerId) -> Option<NodeId> { None }
fn request_from(&self, _: PeerId, _: LesRequest) -> Result<ReqId, LesError> { fn request_from(&self, _: PeerId, _: Requests) -> Result<ReqId, LesError> {
unimplemented!() unimplemented!()
} }
fn make_announcement(&self, _: Announcement) { } fn make_announcement(&self, _: Announcement) { }
fn max_requests(&self, _: PeerId, _: LesRequestKind) -> usize { 0 }
fn disconnect_peer(&self, _: PeerId) { } fn disconnect_peer(&self, _: PeerId) { }
fn disable_peer(&self, _: PeerId) { } fn disable_peer(&self, _: PeerId) { }
} }

View File

@ -294,8 +294,6 @@ mod tests {
let proof = cht.prove(10_000, 0).unwrap().unwrap(); let proof = cht.prove(10_000, 0).unwrap().unwrap();
let req = HeaderProof::new(10_000, cht.root()).unwrap(); let req = HeaderProof::new(10_000, cht.root()).unwrap();
let raw_header = test_client.block_header(::ethcore::ids::BlockId::Number(10_000)).unwrap();
assert!(req.check_response(&proof[..]).is_ok()); assert!(req.check_response(&proof[..]).is_ok());
} }
@ -305,9 +303,9 @@ mod tests {
header.set_number(10_000); header.set_number(10_000);
header.set_extra_data(b"test_header".to_vec()); header.set_extra_data(b"test_header".to_vec());
let hash = header.hash(); let hash = header.hash();
let raw_header = ::rlp::encode(&header); let raw_header = encoded::Header::new(::rlp::encode(&header).to_vec());
assert!(HeaderByHash(hash).check_response(&*raw_header).is_ok()) assert!(HeaderByHash(hash).check_response(&raw_header).is_ok())
} }
#[test] #[test]
@ -323,7 +321,7 @@ mod tests {
hash: header.hash(), hash: header.hash(),
}; };
let response = encoded::Body::new(body_stream.drain()); let response = encoded::Body::new(body_stream.drain().to_vec());
assert!(req.check_response(&response).is_ok()) assert!(req.check_response(&response).is_ok())
} }