2016-01-21 11:25:39 +01:00
|
|
|
//! Net rpc implementation.
|
2016-01-26 13:14:22 +01:00
|
|
|
use jsonrpc_core::*;
|
2016-01-27 17:14:41 +01:00
|
|
|
use v1::traits::Net;
|
2016-01-21 11:25:39 +01:00
|
|
|
|
2016-01-27 17:08:59 +01:00
|
|
|
/// Net rpc implementation.
|
2016-01-21 11:25:39 +01:00
|
|
|
pub struct NetClient;
|
|
|
|
|
|
|
|
impl NetClient {
|
2016-01-27 17:08:59 +01:00
|
|
|
/// Creates new NetClient.
|
2016-01-21 11:25:39 +01:00
|
|
|
pub fn new() -> Self { NetClient }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Net for NetClient {
|
2016-01-25 17:45:26 +01:00
|
|
|
fn version(&self, _: Params) -> Result<Value, Error> {
|
|
|
|
Ok(Value::U64(63))
|
|
|
|
}
|
|
|
|
|
2016-01-21 11:25:39 +01:00
|
|
|
fn peer_count(&self, _params: Params) -> Result<Value, Error> {
|
|
|
|
Ok(Value::U64(0))
|
|
|
|
}
|
|
|
|
}
|