From 1b48d07a9c7b2e8253e80054afd34f2fc3f1d5b7 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Sat, 30 Jan 2016 17:00:36 +0400 Subject: [PATCH] receipt, service --- src/receipt.rs | 16 ++++++++++++++++ src/service.rs | 14 +++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/receipt.rs b/src/receipt.rs index d320373d6..4c6051314 100644 --- a/src/receipt.rs +++ b/src/receipt.rs @@ -36,3 +36,19 @@ impl Encodable for Receipt { s.append(&self.logs); } } + +#[cfg(test)] +mod tests { + use super::*; + use util::*; + + #[test] + fn it_can_be_encoded() { + let mut rlp_stream = RlpStream::new(); + let receipt = Receipt::new(H256::zero(), U256::zero(), vec![]); + rlp_stream.append(&receipt); + + let out = rlp_stream.out(); + assert_eq!(out.len(), 297); + } +} diff --git a/src/service.rs b/src/service.rs index a56ed7f44..f72d50588 100644 --- a/src/service.rs +++ b/src/service.rs @@ -56,7 +56,6 @@ impl ClientService { /// Get client interface pub fn client(&self) -> Arc { self.client.clone() - } /// Get network service component @@ -98,3 +97,16 @@ impl IoHandler for ClientIoHandler { } } +#[cfg(test)] +mod tests { + use super::*; + use tests::helpers::*; + use util::network::*; + + #[test] + fn it_can_be_started() { + let spec = get_test_spec(); + let service = ClientService::start(spec, NetworkConfiguration::new()); + assert!(service.is_ok()); + } +} \ No newline at end of file