@@ -47,10 +47,12 @@ pub use sc_rpc::SubscriptionTaskExecutor;
4747pub use sc_rpc_api:: DenyUnsafe ;
4848use sc_transaction_pool_api:: TransactionPool ;
4949use sp_api:: ProvideRuntimeApi ;
50+ use sp_application_crypto:: RuntimeAppPublic ;
5051use sp_block_builder:: BlockBuilder ;
5152use sp_blockchain:: { Error as BlockChainError , HeaderBackend , HeaderMetadata } ;
5253use sp_consensus:: SelectChain ;
5354use sp_consensus_babe:: BabeApi ;
55+ use sp_consensus_beefy:: AuthorityIdBound ;
5456use sp_keystore:: KeystorePtr ;
5557
5658/// Extra dependencies for BABE.
@@ -76,17 +78,17 @@ pub struct GrandpaDeps<B> {
7678}
7779
7880/// Dependencies for BEEFY
79- pub struct BeefyDeps {
81+ pub struct BeefyDeps < AuthorityId : AuthorityIdBound > {
8082 /// Receives notifications about finality proof events from BEEFY.
81- pub beefy_finality_proof_stream : BeefyVersionedFinalityProofStream < Block > ,
83+ pub beefy_finality_proof_stream : BeefyVersionedFinalityProofStream < Block , AuthorityId > ,
8284 /// Receives notifications about best block events from BEEFY.
8385 pub beefy_best_block_stream : BeefyBestBlockStream < Block > ,
8486 /// Executor to drive the subscription manager in the BEEFY RPC handler.
8587 pub subscription_executor : SubscriptionTaskExecutor ,
8688}
8789
8890/// Full client dependencies.
89- pub struct FullDeps < C , P , SC , B > {
91+ pub struct FullDeps < C , P , SC , B , AuthorityId : AuthorityIdBound > {
9092 /// The client instance to use.
9193 pub client : Arc < C > ,
9294 /// Transaction pool instance.
@@ -102,7 +104,7 @@ pub struct FullDeps<C, P, SC, B> {
102104 /// GRANDPA specific dependencies.
103105 pub grandpa : GrandpaDeps < B > ,
104106 /// BEEFY specific dependencies.
105- pub beefy : BeefyDeps ,
107+ pub beefy : BeefyDeps < AuthorityId > ,
106108 /// Shared statement store reference.
107109 pub statement_store : Arc < dyn sp_statement_store:: StatementStore > ,
108110 /// The backend used by the node.
@@ -112,7 +114,7 @@ pub struct FullDeps<C, P, SC, B> {
112114}
113115
114116/// Instantiate all Full RPC extensions.
115- pub fn create_full < C , P , SC , B > (
117+ pub fn create_full < C , P , SC , B , AuthorityId > (
116118 FullDeps {
117119 client,
118120 pool,
@@ -125,7 +127,7 @@ pub fn create_full<C, P, SC, B>(
125127 statement_store,
126128 backend,
127129 mixnet_api,
128- } : FullDeps < C , P , SC , B > ,
130+ } : FullDeps < C , P , SC , B , AuthorityId > ,
129131) -> Result < RpcModule < ( ) > , Box < dyn std:: error:: Error + Send + Sync > >
130132where
131133 C : ProvideRuntimeApi < Block >
@@ -145,6 +147,8 @@ where
145147 SC : SelectChain < Block > + ' static ,
146148 B : sc_client_api:: Backend < Block > + Send + Sync + ' static ,
147149 B :: State : sc_client_api:: backend:: StateBackend < sp_runtime:: traits:: HashingFor < Block > > ,
150+ AuthorityId : AuthorityIdBound ,
151+ <AuthorityId as RuntimeAppPublic >:: Signature : Send + Sync ,
148152{
149153 use mmr_rpc:: { Mmr , MmrApiServer } ;
150154 use pallet_transaction_payment_rpc:: { TransactionPayment , TransactionPaymentApiServer } ;
@@ -223,7 +227,7 @@ where
223227 }
224228
225229 io. merge (
226- Beefy :: < Block > :: new (
230+ Beefy :: < Block , AuthorityId > :: new (
227231 beefy. beefy_finality_proof_stream ,
228232 beefy. beefy_best_block_stream ,
229233 beefy. subscription_executor ,
0 commit comments