Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes after rebasing master
  • Loading branch information
bkchr committed Nov 13, 2018
commit 42213c7e0c0709f684679a3fe708d7c248e04cac
28 changes: 7 additions & 21 deletions core/service/src/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
use std::{sync::Arc, net::SocketAddr, marker::PhantomData, ops::Deref};
use serde::{Serialize, de::DeserializeOwned};
use tokio::runtime::TaskExecutor;
use chain_spec::ChainSpec;
use chain_spec::{ChainSpec, Properties};
use client_db;
use client::{self, Client, runtime_api::{TaggedTransactionQueue, Metadata}};
use {error, Service, RpcConfig, maybe_start_server, TransactionPoolAdapter};
use network::{self, OnDemand, import_queue::ImportQueue};
use substrate_executor::{NativeExecutor, NativeExecutionDispatch};
use transaction_pool::txpool::{self, Options as TransactionPoolOptions, Pool as TransactionPool};
use runtime_primitives::{traits::Block as BlockT, traits::Header as HeaderT, BuildStorage};
use runtime_primitives::{traits::Block as BlockT, traits::Header as HeaderT, BuildStorage, generic::SignedBlock};
use config::Configuration;
use primitives::{Blake2Hasher, H256};
use rpc;
Expand Down Expand Up @@ -125,42 +125,28 @@ pub trait StartRPC<C: Components> {
impl_version: &'static str,
rpc_http: Option<SocketAddr>,
rpc_ws: Option<SocketAddr>,
properties: Properties,
task_executor: TaskExecutor,
transaction_pool: Arc<TransactionPool<C::TransactionPoolApi>>,
) -> Result<(Option<rpc::HttpServer>, Option<rpc::WsServer>), error::Error>;
}

<<<<<<< HEAD
impl<T: Components> StartRPC<Self> for T where
T::RuntimeApi:
client::runtime_api::Metadata<
ComponentBlock<T>,
std::vec::Vec<u8>,
Error=client::error::Error
>
+ client::runtime_api::ConstructRuntimeApi<Block=ComponentBlock<T>>
+ client::runtime_api::Core<
ComponentBlock<T>,
primitives::AuthorityId,
Error=client::error::Error,
OverlayedChanges=client::runtime_api::OverlayedChanges
>,
T::RuntimeApi: Metadata<ComponentBlock<T>>,
for<'de> SignedBlock<ComponentBlock<T>>: ::serde::Deserialize<'de>,
{
=======
impl<T: Components> StartRPC<Self> for T where T::RuntimeApi: Metadata<ComponentBlock<T>> {
>>>>>>> Move `sr-api` into client and more refactoring
fn start_rpc(
client: Arc<Client<T::Backend, T::Executor, ComponentBlock<T>, T::RuntimeApi>>,
chain_name: String,
impl_name: &'static str,
impl_version: &'static str,
rpc_http: Option<SocketAddr>,
rpc_ws: Option<SocketAddr>,
properties: Properties,
task_executor: TaskExecutor,
transaction_pool: Arc<TransactionPool<T::TransactionPoolApi>>,
) -> Result<(Option<rpc::HttpServer>, Option<rpc::WsServer>), error::Error> {
let rpc_config = RpcConfig { chain_name, impl_name, impl_version };
let rpc_config = RpcConfig { properties, chain_name, impl_name, impl_version };

let handler = || {
let client = client.clone();
Expand All @@ -170,7 +156,7 @@ impl<T: Components> StartRPC<Self> for T where T::RuntimeApi: Metadata<Component
let author = rpc::apis::author::Author::new(
client.clone(), transaction_pool.clone(), subscriptions
);
rpc::rpc_handler::<ComponentBlock<T>, ComponentExHash<T>, _, _, _, _, _>(
rpc::rpc_handler::<ComponentBlock<T>, ComponentExHash<T>, _, _, _, _>(
state,
chain,
author,
Expand Down
6 changes: 3 additions & 3 deletions core/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use parking_lot::{Mutex, RwLock};
use keystore::Store as Keystore;
use client::BlockchainEvents;
use runtime_primitives::traits::{Header, As};
use runtime_primitives::generic::{BlockId, SignedBlock};
use runtime_primitives::generic::BlockId;
use exit_future::Signal;
#[doc(hidden)]
pub use tokio::runtime::TaskExecutor;
Expand Down Expand Up @@ -232,8 +232,8 @@ impl<Components> Service<Components>
// RPC
let (rpc_http, rpc_ws) = Components::RPC::start_rpc(
client.clone(), config.chain_spec.name().to_string(), config.impl_name,
config.impl_version, config.rpc_http, config.rpc_ws, task_executor.clone(),
transaction_pool.clone()
config.impl_version, config.rpc_http, config.rpc_ws, config.chain_spec.properties(),
task_executor.clone(), transaction_pool.clone()
)?;

let proposer = Arc::new(ProposerFactory {
Expand Down
7 changes: 0 additions & 7 deletions core/sr-primitives/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,6 @@ pub trait ProvideInherent {
) -> Result<(), Self::Error>;
}

/// Something that acts like an `Extrinsic`.
pub trait Extrinsic {
/// Is this `Extrinsic` signed?
/// If no information are available about signed/unsigned, `None` should be returned.
fn is_signed(&self) -> Option<bool> { None }
}

/// Auxiliary wrapper that holds an api instance and binds it to the given lifetime.
pub struct ApiRef<'a, T>(T, rstd::marker::PhantomData<&'a ()>);

Expand Down
14 changes: 2 additions & 12 deletions core/test-runtime/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
14 changes: 2 additions & 12 deletions node/runtime/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.