@@ -17,10 +17,9 @@ use sc_client_api::client::BlockchainEvents;
1717use sc_network_sync:: SyncingService ;
1818use sc_rpc:: SubscriptionTaskExecutor ;
1919use sc_service:: { Configuration , TaskManager , error:: Error as ServiceError } ;
20- use sc_transaction_pool:: ChainApi ;
2120use sc_transaction_pool_api:: TransactionPool ;
2221use sp_inherents:: CreateInherentDataProviders ;
23- use sp_runtime:: traits:: Block as BlockT ;
22+ use sp_runtime:: { OpaqueExtrinsic , traits:: BlakeTwo256 , traits :: Block as BlockT } ;
2423use std:: path:: PathBuf ;
2524use std:: time:: Duration ;
2625use std:: {
@@ -196,13 +195,18 @@ pub async fn spawn_frontier_tasks(
196195 ) ;
197196}
198197
199- fn extend_rpc_aet_api < P , A , CT , CIDP , EC > (
198+ fn extend_rpc_aet_api < P , CT , CIDP , EC > (
200199 io : & mut RpcModule < ( ) > ,
201- deps : & EthDeps < P , A , CT , CIDP > ,
200+ deps : & EthDeps < P , CT , CIDP > ,
202201) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > >
203202where
204- P : TransactionPool < Block = Block > + ' static ,
205- A : ChainApi < Block = Block > + ' static ,
203+ P : TransactionPool <
204+ Block = Block ,
205+ Hash = <sp_runtime:: generic:: Block <
206+ sp_runtime:: generic:: Header < u32 , BlakeTwo256 > ,
207+ OpaqueExtrinsic ,
208+ > as BlockT >:: Hash ,
209+ > + ' static ,
206210 CT : ConvertTransaction < <Block as BlockT >:: Extrinsic > + Send + Sync + Clone + ' static ,
207211 CIDP : CreateInherentDataProviders < Block , ( ) > + Send + Clone + ' static ,
208212 EC : EthConfig < Block , FullClient > ,
@@ -213,7 +217,7 @@ where
213217 }
214218
215219 io. merge (
216- Eth :: < Block , FullClient , P , CT , FullBackend , A , CIDP , EC > :: new (
220+ Eth :: < Block , FullClient , P , CT , FullBackend , CIDP , EC > :: new (
217221 deps. client . clone ( ) ,
218222 deps. pool . clone ( ) ,
219223 deps. graph . clone ( ) ,
@@ -239,13 +243,18 @@ where
239243 Ok ( ( ) )
240244}
241245
242- fn extend_rpc_eth_filter < P , A , CT , CIDP > (
246+ fn extend_rpc_eth_filter < P , CT , CIDP > (
243247 io : & mut RpcModule < ( ) > ,
244- deps : & EthDeps < P , A , CT , CIDP > ,
248+ deps : & EthDeps < P , CT , CIDP > ,
245249) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > >
246250where
247- P : TransactionPool < Block = Block > + ' static ,
248- A : ChainApi < Block = Block > + ' static ,
251+ P : TransactionPool <
252+ Block = Block ,
253+ Hash = <sp_runtime:: generic:: Block <
254+ sp_runtime:: generic:: Header < u32 , BlakeTwo256 > ,
255+ OpaqueExtrinsic ,
256+ > as BlockT >:: Hash ,
257+ > + ' static ,
249258 CT : ConvertTransaction < <Block as BlockT >:: Extrinsic > + Send + Sync + Clone + ' static ,
250259 CIDP : CreateInherentDataProviders < Block , ( ) > + Send + Clone + ' static ,
251260{
@@ -267,9 +276,9 @@ where
267276}
268277
269278// Function for EthPubSub merge
270- fn extend_rpc_eth_pubsub < P , A , CT , CIDP > (
279+ fn extend_rpc_eth_pubsub < P , CT , CIDP > (
271280 io : & mut RpcModule < ( ) > ,
272- deps : & EthDeps < P , A , CT , CIDP > ,
281+ deps : & EthDeps < P , CT , CIDP > ,
273282 subscription_task_executor : SubscriptionTaskExecutor ,
274283 pubsub_notification_sinks : Arc <
275284 fc_mapping_sync:: EthereumBlockNotificationSinks <
@@ -278,8 +287,13 @@ fn extend_rpc_eth_pubsub<P, A, CT, CIDP>(
278287 > ,
279288) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > >
280289where
281- P : TransactionPool < Block = Block > + ' static ,
282- A : ChainApi < Block = Block > + ' static ,
290+ P : TransactionPool <
291+ Block = Block ,
292+ Hash = <sp_runtime:: generic:: Block <
293+ sp_runtime:: generic:: Header < u32 , BlakeTwo256 > ,
294+ OpaqueExtrinsic ,
295+ > as BlockT >:: Hash ,
296+ > + ' static ,
283297 CT : ConvertTransaction < <Block as BlockT >:: Extrinsic > + Send + Sync + ' static ,
284298 CIDP : CreateInherentDataProviders < Block , ( ) > + Send + ' static ,
285299{
@@ -297,13 +311,18 @@ where
297311 Ok ( ( ) )
298312}
299313
300- fn extend_rpc_net < P , A , CT , CIDP > (
314+ fn extend_rpc_net < P , CT , CIDP > (
301315 io : & mut RpcModule < ( ) > ,
302- deps : & EthDeps < P , A , CT , CIDP > ,
316+ deps : & EthDeps < P , CT , CIDP > ,
303317) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > >
304318where
305- P : TransactionPool < Block = Block > + ' static ,
306- A : ChainApi < Block = Block > + ' static ,
319+ P : TransactionPool <
320+ Block = Block ,
321+ Hash = <sp_runtime:: generic:: Block <
322+ sp_runtime:: generic:: Header < u32 , BlakeTwo256 > ,
323+ OpaqueExtrinsic ,
324+ > as BlockT >:: Hash ,
325+ > + ' static ,
307326 CT : ConvertTransaction < <Block as BlockT >:: Extrinsic > + Send + Sync + ' static ,
308327 CIDP : CreateInherentDataProviders < Block , ( ) > + Send + ' static ,
309328{
@@ -318,27 +337,37 @@ where
318337 Ok ( ( ) )
319338}
320339
321- fn extend_rpc_web3 < P , A , CT , CIDP > (
340+ fn extend_rpc_web3 < P , CT , CIDP > (
322341 io : & mut RpcModule < ( ) > ,
323- deps : & EthDeps < P , A , CT , CIDP > ,
342+ deps : & EthDeps < P , CT , CIDP > ,
324343) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > >
325344where
326- P : TransactionPool < Block = Block > + ' static ,
327- A : ChainApi < Block = Block > + ' static ,
345+ P : TransactionPool <
346+ Block = Block ,
347+ Hash = <sp_runtime:: generic:: Block <
348+ sp_runtime:: generic:: Header < u32 , BlakeTwo256 > ,
349+ OpaqueExtrinsic ,
350+ > as BlockT >:: Hash ,
351+ > + ' static ,
328352 CT : ConvertTransaction < <Block as BlockT >:: Extrinsic > + Send + Sync + ' static ,
329353 CIDP : CreateInherentDataProviders < Block , ( ) > + Send + ' static ,
330354{
331355 io. merge ( Web3 :: new ( deps. client . clone ( ) ) . into_rpc ( ) ) ?;
332356 Ok ( ( ) )
333357}
334358
335- fn extend_rpc_debug < P , A , CT , CIDP > (
359+ fn extend_rpc_debug < P , CT , CIDP > (
336360 io : & mut RpcModule < ( ) > ,
337- deps : & EthDeps < P , A , CT , CIDP > ,
361+ deps : & EthDeps < P , CT , CIDP > ,
338362) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > >
339363where
340- P : TransactionPool < Block = Block > + ' static ,
341- A : ChainApi < Block = Block > + ' static ,
364+ P : TransactionPool <
365+ Block = Block ,
366+ Hash = <sp_runtime:: generic:: Block <
367+ sp_runtime:: generic:: Header < u32 , BlakeTwo256 > ,
368+ OpaqueExtrinsic ,
369+ > as BlockT >:: Hash ,
370+ > + ' static ,
342371 CT : ConvertTransaction < <Block as BlockT >:: Extrinsic > + Send + Sync + ' static ,
343372 CIDP : CreateInherentDataProviders < Block , ( ) > + Send + ' static ,
344373{
@@ -355,9 +384,9 @@ where
355384}
356385
357386/// Extend RpcModule with Eth RPCs
358- pub fn create_eth < P , A , CT , CIDP , EC > (
387+ pub fn create_eth < P , CT , CIDP , EC > (
359388 mut io : RpcModule < ( ) > ,
360- deps : EthDeps < P , A , CT , CIDP > ,
389+ deps : EthDeps < P , CT , CIDP > ,
361390 subscription_task_executor : SubscriptionTaskExecutor ,
362391 pubsub_notification_sinks : Arc <
363392 fc_mapping_sync:: EthereumBlockNotificationSinks <
@@ -366,23 +395,28 @@ pub fn create_eth<P, A, CT, CIDP, EC>(
366395 > ,
367396) -> Result < RpcModule < ( ) > , Box < dyn std:: error:: Error + Send + Sync > >
368397where
369- P : TransactionPool < Block = Block > + ' static ,
370- A : ChainApi < Block = Block > + ' static ,
398+ P : TransactionPool <
399+ Block = Block ,
400+ Hash = <sp_runtime:: generic:: Block <
401+ sp_runtime:: generic:: Header < u32 , BlakeTwo256 > ,
402+ OpaqueExtrinsic ,
403+ > as BlockT >:: Hash ,
404+ > + ' static ,
371405 CT : ConvertTransaction < <Block as BlockT >:: Extrinsic > + Send + Sync + Clone + ' static ,
372406 CIDP : CreateInherentDataProviders < Block , ( ) > + Send + Clone + ' static ,
373407 EC : EthConfig < Block , FullClient > ,
374408{
375- extend_rpc_aet_api :: < P , A , CT , CIDP , EC > ( & mut io, & deps) ?;
376- extend_rpc_eth_filter :: < P , A , CT , CIDP > ( & mut io, & deps) ?;
377- extend_rpc_eth_pubsub :: < P , A , CT , CIDP > (
409+ extend_rpc_aet_api :: < P , CT , CIDP , EC > ( & mut io, & deps) ?;
410+ extend_rpc_eth_filter :: < P , CT , CIDP > ( & mut io, & deps) ?;
411+ extend_rpc_eth_pubsub :: < P , CT , CIDP > (
378412 & mut io,
379413 & deps,
380414 subscription_task_executor,
381415 pubsub_notification_sinks,
382416 ) ?;
383- extend_rpc_net :: < P , A , CT , CIDP > ( & mut io, & deps) ?;
384- extend_rpc_web3 :: < P , A , CT , CIDP > ( & mut io, & deps) ?;
385- extend_rpc_debug :: < P , A , CT , CIDP > ( & mut io, & deps) ?;
417+ extend_rpc_net :: < P , CT , CIDP > ( & mut io, & deps) ?;
418+ extend_rpc_web3 :: < P , CT , CIDP > ( & mut io, & deps) ?;
419+ extend_rpc_debug :: < P , CT , CIDP > ( & mut io, & deps) ?;
386420
387421 Ok ( io)
388422}
0 commit comments