Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 42213c7

Browse files
committed
Fixes after rebasing master
1 parent be9c57d commit 42213c7

File tree

7 files changed

+14
-55
lines changed

7 files changed

+14
-55
lines changed

core/service/src/components.rs

+7-21
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
use std::{sync::Arc, net::SocketAddr, marker::PhantomData, ops::Deref};
2020
use serde::{Serialize, de::DeserializeOwned};
2121
use tokio::runtime::TaskExecutor;
22-
use chain_spec::ChainSpec;
22+
use chain_spec::{ChainSpec, Properties};
2323
use client_db;
2424
use client::{self, Client, runtime_api::{TaggedTransactionQueue, Metadata}};
2525
use {error, Service, RpcConfig, maybe_start_server, TransactionPoolAdapter};
2626
use network::{self, OnDemand, import_queue::ImportQueue};
2727
use substrate_executor::{NativeExecutor, NativeExecutionDispatch};
2828
use transaction_pool::txpool::{self, Options as TransactionPoolOptions, Pool as TransactionPool};
29-
use runtime_primitives::{traits::Block as BlockT, traits::Header as HeaderT, BuildStorage};
29+
use runtime_primitives::{traits::Block as BlockT, traits::Header as HeaderT, BuildStorage, generic::SignedBlock};
3030
use config::Configuration;
3131
use primitives::{Blake2Hasher, H256};
3232
use rpc;
@@ -125,42 +125,28 @@ pub trait StartRPC<C: Components> {
125125
impl_version: &'static str,
126126
rpc_http: Option<SocketAddr>,
127127
rpc_ws: Option<SocketAddr>,
128+
properties: Properties,
128129
task_executor: TaskExecutor,
129130
transaction_pool: Arc<TransactionPool<C::TransactionPoolApi>>,
130131
) -> Result<(Option<rpc::HttpServer>, Option<rpc::WsServer>), error::Error>;
131132
}
132133

133-
<<<<<<< HEAD
134134
impl<T: Components> StartRPC<Self> for T where
135-
T::RuntimeApi:
136-
client::runtime_api::Metadata<
137-
ComponentBlock<T>,
138-
std::vec::Vec<u8>,
139-
Error=client::error::Error
140-
>
141-
+ client::runtime_api::ConstructRuntimeApi<Block=ComponentBlock<T>>
142-
+ client::runtime_api::Core<
143-
ComponentBlock<T>,
144-
primitives::AuthorityId,
145-
Error=client::error::Error,
146-
OverlayedChanges=client::runtime_api::OverlayedChanges
147-
>,
135+
T::RuntimeApi: Metadata<ComponentBlock<T>>,
148136
for<'de> SignedBlock<ComponentBlock<T>>: ::serde::Deserialize<'de>,
149137
{
150-
=======
151-
impl<T: Components> StartRPC<Self> for T where T::RuntimeApi: Metadata<ComponentBlock<T>> {
152-
>>>>>>> Move `sr-api` into client and more refactoring
153138
fn start_rpc(
154139
client: Arc<Client<T::Backend, T::Executor, ComponentBlock<T>, T::RuntimeApi>>,
155140
chain_name: String,
156141
impl_name: &'static str,
157142
impl_version: &'static str,
158143
rpc_http: Option<SocketAddr>,
159144
rpc_ws: Option<SocketAddr>,
145+
properties: Properties,
160146
task_executor: TaskExecutor,
161147
transaction_pool: Arc<TransactionPool<T::TransactionPoolApi>>,
162148
) -> Result<(Option<rpc::HttpServer>, Option<rpc::WsServer>), error::Error> {
163-
let rpc_config = RpcConfig { chain_name, impl_name, impl_version };
149+
let rpc_config = RpcConfig { properties, chain_name, impl_name, impl_version };
164150

165151
let handler = || {
166152
let client = client.clone();
@@ -170,7 +156,7 @@ impl<T: Components> StartRPC<Self> for T where T::RuntimeApi: Metadata<Component
170156
let author = rpc::apis::author::Author::new(
171157
client.clone(), transaction_pool.clone(), subscriptions
172158
);
173-
rpc::rpc_handler::<ComponentBlock<T>, ComponentExHash<T>, _, _, _, _, _>(
159+
rpc::rpc_handler::<ComponentBlock<T>, ComponentExHash<T>, _, _, _, _>(
174160
state,
175161
chain,
176162
author,

core/service/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use parking_lot::{Mutex, RwLock};
6767
use keystore::Store as Keystore;
6868
use client::BlockchainEvents;
6969
use runtime_primitives::traits::{Header, As};
70-
use runtime_primitives::generic::{BlockId, SignedBlock};
70+
use runtime_primitives::generic::BlockId;
7171
use exit_future::Signal;
7272
#[doc(hidden)]
7373
pub use tokio::runtime::TaskExecutor;
@@ -232,8 +232,8 @@ impl<Components> Service<Components>
232232
// RPC
233233
let (rpc_http, rpc_ws) = Components::RPC::start_rpc(
234234
client.clone(), config.chain_spec.name().to_string(), config.impl_name,
235-
config.impl_version, config.rpc_http, config.rpc_ws, task_executor.clone(),
236-
transaction_pool.clone()
235+
config.impl_version, config.rpc_http, config.rpc_ws, config.chain_spec.properties(),
236+
task_executor.clone(), transaction_pool.clone()
237237
)?;
238238

239239
let proposer = Arc::new(ProposerFactory {

core/sr-primitives/src/traits.rs

-7
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,6 @@ pub trait ProvideInherent {
600600
) -> Result<(), Self::Error>;
601601
}
602602

603-
/// Something that acts like an `Extrinsic`.
604-
pub trait Extrinsic {
605-
/// Is this `Extrinsic` signed?
606-
/// If no information are available about signed/unsigned, `None` should be returned.
607-
fn is_signed(&self) -> Option<bool> { None }
608-
}
609-
610603
/// Auxiliary wrapper that holds an api instance and binds it to the given lifetime.
611604
pub struct ApiRef<'a, T>(T, rstd::marker::PhantomData<&'a ()>);
612605

core/test-runtime/wasm/Cargo.lock

+2-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/runtime/wasm/Cargo.lock

+2-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

0 commit comments

Comments
 (0)