rpc dependencies relayout

This commit is contained in:
NikVolf
2016-07-16 15:51:06 +02:00
parent 98ddff1326
commit 4cb1c906b0
10 changed files with 63 additions and 31 deletions

View File

@@ -46,7 +46,7 @@ use v1::impls::{default_gas_price, dispatch_transaction, error_codes};
use serde;
/// Eth rpc implementation.
pub struct EthClient<C, S, M, EM> where
pub struct EthClient<C, S: ?Sized, M, EM> where
C: MiningBlockChainClient,
S: SyncProvider,
M: MinerService,
@@ -61,7 +61,7 @@ pub struct EthClient<C, S, M, EM> where
allow_pending_receipt_query: bool,
}
impl<C, S, M, EM> EthClient<C, S, M, EM> where
impl<C, S: ?Sized, M, EM> EthClient<C, S, M, EM> where
C: MiningBlockChainClient,
S: SyncProvider,
M: MinerService,
@@ -242,7 +242,7 @@ fn no_author_err() -> Error {
}
}
impl<C, S, M, EM> EthClient<C, S, M, EM> where
impl<C, S: ?Sized, M, EM> EthClient<C, S, M, EM> where
C: MiningBlockChainClient + 'static,
S: SyncProvider + 'static,
M: MinerService + 'static,
@@ -255,7 +255,7 @@ impl<C, S, M, EM> EthClient<C, S, M, EM> where
}
}
impl<C, S, M, EM> Eth for EthClient<C, S, M, EM> where
impl<C, S: ?Sized, M, EM> Eth for EthClient<C, S, M, EM> where
C: MiningBlockChainClient + 'static,
S: SyncProvider + 'static,
M: MinerService + 'static,

View File

@@ -21,11 +21,11 @@ use ethsync::SyncProvider;
use v1::traits::Net;
/// Net rpc implementation.
pub struct NetClient<S> where S: SyncProvider {
pub struct NetClient<S: ?Sized> where S: SyncProvider {
sync: Weak<S>
}
impl<S> NetClient<S> where S: SyncProvider {
impl<S: ?Sized> NetClient<S> where S: SyncProvider {
/// Creates new NetClient.
pub fn new(sync: &Arc<S>) -> Self {
NetClient {
@@ -34,7 +34,7 @@ impl<S> NetClient<S> where S: SyncProvider {
}
}
impl<S> Net for NetClient<S> where S: SyncProvider + 'static {
impl<S: ?Sized> Net for NetClient<S> where S: SyncProvider + 'static {
fn version(&self, _: Params) -> Result<Value, Error> {
Ok(Value::String(format!("{}", take_weak!(self.sync).status().network_id).to_owned()))
}