openethereum/rpc/src/v1/impls/web3.rs
2016-02-03 17:35:25 +01:00

22 lines
527 B
Rust

//! Web3 rpc implementation.
use target_info::Target;
use jsonrpc_core::*;
use v1::traits::Web3;
/// Web3 rpc implementation.
pub struct Web3Client;
impl Web3Client {
/// Creates new Web3Client.
pub fn new() -> Self { Web3Client }
}
impl Web3 for Web3Client {
fn client_version(&self, params: Params) -> Result<Value, Error> {
match params {
Params::None => Ok(Value::String(format!("parity/{}/{}/rust1.8-nightly", env!("CARGO_PKG_VERSION"), Target::os()).to_owned())),
_ => Err(Error::invalid_params())
}
}
}