From 0c4cd00c1f821eae546f6f6fb925380f5f126300 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 22 May 2016 12:42:22 +0200 Subject: [PATCH] Fix styling - don't mix spaces with tabs!!! --- rpc/src/v1/impls/eth.rs | 58 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index 9a542ea2b..21f89eee6 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -41,12 +41,13 @@ use util::keys::store::AccountProvider; use serde; /// Eth rpc implementation. -pub struct EthClient - where C: BlockChainClient, - S: SyncProvider, - A: AccountProvider, - M: MinerService, - EM: ExternalMinerService { +pub struct EthClient where + C: BlockChainClient, + S: SyncProvider, + A: AccountProvider, + M: MinerService, + EM: ExternalMinerService { + client: Weak, sync: Weak, accounts: Weak, @@ -55,12 +56,12 @@ pub struct EthClient seed_compute: Mutex, } -impl EthClient - where C: BlockChainClient, - S: SyncProvider, - A: AccountProvider, - M: MinerService, - EM: ExternalMinerService { +impl EthClient where + C: BlockChainClient, + S: SyncProvider, + A: AccountProvider, + M: MinerService, + EM: ExternalMinerService { /// Creates new EthClient. pub fn new(client: &Arc, sync: &Arc, accounts: &Arc, miner: &Arc, em: &Arc) @@ -214,12 +215,12 @@ fn from_params_default_third(params: Params) -> Result<(F1, F2, BlockNum } } -impl Eth for EthClient - where C: BlockChainClient + 'static, - S: SyncProvider + 'static, - A: AccountProvider + 'static, - M: MinerService + 'static, - EM: ExternalMinerService + 'static { +impl Eth for EthClient where + C: BlockChainClient + 'static, + S: SyncProvider + 'static, + A: AccountProvider + 'static, + M: MinerService + 'static, + EM: ExternalMinerService + 'static { fn protocol_version(&self, params: Params) -> Result { match params { @@ -252,7 +253,6 @@ impl Eth for EthClient } } - // TODO: do not hardcode author. fn author(&self, params: Params) -> Result { match params { Params::None => to_value(&take_weak!(self.miner).author()), @@ -260,7 +260,6 @@ impl Eth for EthClient } } - // TODO: return real value of mining once it's implemented. fn is_mining(&self, params: Params) -> Result { match params { Params::None => to_value(&self.external_miner.is_mining()), @@ -268,7 +267,6 @@ impl Eth for EthClient } } - // TODO: return real hashrate once we have mining fn hashrate(&self, params: Params) -> Result { match params { Params::None => to_value(&self.external_miner.hashrate()), @@ -550,18 +548,18 @@ impl Eth for EthClient } /// Eth filter rpc implementation. -pub struct EthFilterClient - where C: BlockChainClient, - M: MinerService { +pub struct EthFilterClient where + C: BlockChainClient, + M: MinerService { client: Weak, miner: Weak, polls: Mutex>, } -impl EthFilterClient - where C: BlockChainClient, - M: MinerService { +impl EthFilterClient where + C: BlockChainClient, + M: MinerService { /// Creates new Eth filter client. pub fn new(client: &Arc, miner: &Arc) -> Self { @@ -573,9 +571,9 @@ impl EthFilterClient } } -impl EthFilter for EthFilterClient - where C: BlockChainClient + 'static, - M: MinerService + 'static { +impl EthFilter for EthFilterClient where + C: BlockChainClient + 'static, + M: MinerService + 'static { fn new_filter(&self, params: Params) -> Result { from_params::<(Filter,)>(params)