fc_rpc/eth/
mining.rs

1// This file is part of Frontier.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
5
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19use ethereum_types::{H256, H64, U256};
20use jsonrpsee::core::RpcResult;
21// Substrate
22use sp_runtime::traits::Block as BlockT;
23// Frontier
24use fc_rpc_core::types::*;
25
26use crate::eth::Eth;
27
28impl<B, C, P, CT, BE, CIDP, EC> Eth<B, C, P, CT, BE, CIDP, EC>
29where
30	B: BlockT,
31{
32	pub fn is_mining(&self) -> RpcResult<bool> {
33		Ok(self.is_authority)
34	}
35
36	pub fn hashrate(&self) -> RpcResult<U256> {
37		Ok(U256::zero())
38	}
39
40	pub fn work(&self) -> RpcResult<Work> {
41		Ok(Work::default())
42	}
43
44	pub fn submit_hashrate(&self, _: U256, _: H256) -> RpcResult<bool> {
45		Ok(false)
46	}
47
48	pub fn submit_work(&self, _: H64, _: H256, _: H256) -> RpcResult<bool> {
49		Ok(false)
50	}
51}