net tests

This commit is contained in:
debris
2016-03-11 10:17:20 +01:00
parent 87dd42f7bc
commit 34a120e127
7 changed files with 153 additions and 4 deletions

View File

@@ -36,10 +36,10 @@ impl<S> NetClient<S> where S: SyncProvider {
impl<S> Net for NetClient<S> where S: SyncProvider + 'static {
fn version(&self, _: Params) -> Result<Value, Error> {
Ok(Value::U64(take_weak!(self.sync).status().protocol_version as u64))
Ok(Value::String(format!("{}", take_weak!(self.sync).status().protocol_version).to_owned()))
}
fn peer_count(&self, _params: Params) -> Result<Value, Error> {
Ok(Value::U64(take_weak!(self.sync).status().num_peers as u64))
Ok(Value::String(format!("0x{:x}", take_weak!(self.sync).status().num_peers as u64).to_owned()))
}
}