19
19
use std:: { sync:: Arc , net:: SocketAddr , marker:: PhantomData , ops:: Deref } ;
20
20
use serde:: { Serialize , de:: DeserializeOwned } ;
21
21
use tokio:: runtime:: TaskExecutor ;
22
- use chain_spec:: ChainSpec ;
22
+ use chain_spec:: { ChainSpec , Properties } ;
23
23
use client_db;
24
24
use client:: { self , Client , runtime_api:: { TaggedTransactionQueue , Metadata } } ;
25
25
use { error, Service , RpcConfig , maybe_start_server, TransactionPoolAdapter } ;
26
26
use network:: { self , OnDemand , import_queue:: ImportQueue } ;
27
27
use substrate_executor:: { NativeExecutor , NativeExecutionDispatch } ;
28
28
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 } ;
30
30
use config:: Configuration ;
31
31
use primitives:: { Blake2Hasher , H256 } ;
32
32
use rpc;
@@ -125,42 +125,28 @@ pub trait StartRPC<C: Components> {
125
125
impl_version : & ' static str ,
126
126
rpc_http : Option < SocketAddr > ,
127
127
rpc_ws : Option < SocketAddr > ,
128
+ properties : Properties ,
128
129
task_executor : TaskExecutor ,
129
130
transaction_pool : Arc < TransactionPool < C :: TransactionPoolApi > > ,
130
131
) -> Result < ( Option < rpc:: HttpServer > , Option < rpc:: WsServer > ) , error:: Error > ;
131
132
}
132
133
133
- <<<<<<< HEAD
134
134
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 > > ,
148
136
for < ' de > SignedBlock < ComponentBlock < T > > : :: serde:: Deserialize < ' de > ,
149
137
{
150
- =======
151
- impl <T : Components > StartRPC < Self > for T where T :: RuntimeApi : Metadata < ComponentBlock < T > > {
152
- >>>>>>> Move `sr-api` into client and more refactoring
153
138
fn start_rpc (
154
139
client : Arc < Client < T :: Backend , T :: Executor , ComponentBlock < T > , T :: RuntimeApi > > ,
155
140
chain_name : String ,
156
141
impl_name : & ' static str ,
157
142
impl_version : & ' static str ,
158
143
rpc_http : Option < SocketAddr > ,
159
144
rpc_ws : Option < SocketAddr > ,
145
+ properties : Properties ,
160
146
task_executor : TaskExecutor ,
161
147
transaction_pool : Arc < TransactionPool < T :: TransactionPoolApi > > ,
162
148
) -> 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 } ;
164
150
165
151
let handler = || {
166
152
let client = client. clone ( ) ;
@@ -170,7 +156,7 @@ impl<T: Components> StartRPC<Self> for T where T::RuntimeApi: Metadata<Component
170
156
let author = rpc:: apis:: author:: Author :: new (
171
157
client. clone ( ) , transaction_pool. clone ( ) , subscriptions
172
158
) ;
173
- rpc:: rpc_handler :: < ComponentBlock < T > , ComponentExHash < T > , _ , _ , _ , _ , _ > (
159
+ rpc:: rpc_handler :: < ComponentBlock < T > , ComponentExHash < T > , _ , _ , _ , _ > (
174
160
state,
175
161
chain,
176
162
author,
0 commit comments