receipt, service

This commit is contained in:
Nikolay Volf 2016-01-30 17:00:36 +04:00
parent 3f492d5ac2
commit 1b48d07a9c
2 changed files with 29 additions and 1 deletions

View File

@ -36,3 +36,19 @@ impl Encodable for Receipt {
s.append(&self.logs); 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);
}
}

View File

@ -56,7 +56,6 @@ impl ClientService {
/// Get client interface /// Get client interface
pub fn client(&self) -> Arc<Client> { pub fn client(&self) -> Arc<Client> {
self.client.clone() self.client.clone()
} }
/// Get network service component /// Get network service component
@ -98,3 +97,16 @@ impl IoHandler<NetSyncMessage> 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());
}
}