openethereum/rpc/src/v1/impls/net.rs

22 lines
402 B
Rust
Raw Normal View History

2016-01-21 11:25:39 +01:00
//! Net rpc implementation.
2016-01-26 13:14:22 +01:00
use jsonrpc_core::*;
use v1::traits::Net;
2016-01-21 11:25:39 +01:00
/// Net rpc implementation.
2016-01-21 11:25:39 +01:00
pub struct NetClient;
impl NetClient {
/// 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))
}
}