// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// OpenEthereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with OpenEthereum. If not, see .
//! Eth rpc interface.
use ethereum_types::{H160, H256, H64, U256, U64};
use jsonrpc_core::{BoxFuture, Result};
use jsonrpc_derive::rpc;
use v1::types::{
BlockNumber, Bytes, CallRequest, EthAccount, Filter, FilterChanges, Index, Log, Receipt,
RichBlock, SyncStatus, Transaction, Work,
};
/// Eth rpc interface.
#[rpc(server)]
pub trait Eth {
/// RPC Metadata
type Metadata;
/// Returns protocol version encoded as a string (quotes are necessary).
#[rpc(name = "eth_protocolVersion")]
fn protocol_version(&self) -> Result;
/// Returns an object with data about the sync status or false. (wtf?)
#[rpc(name = "eth_syncing")]
fn syncing(&self) -> Result;
/// Returns the number of hashes per second that the node is mining with.
#[rpc(name = "eth_hashrate")]
fn hashrate(&self) -> Result;
/// Returns block author.
#[rpc(name = "eth_coinbase")]
fn author(&self) -> Result;
/// Returns true if client is actively mining new blocks.
#[rpc(name = "eth_mining")]
fn is_mining(&self) -> Result;
/// Returns the chain ID used for transaction signing at the
/// current best block. None is returned if not
/// available.
#[rpc(name = "eth_chainId")]
fn chain_id(&self) -> Result