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

Commit 2426a3d

Browse files
committed
WIP: work on trait bounds for FullDeps
1 parent 9937353 commit 2426a3d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bin/node/rpc/src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ pub struct BabeDeps {
6969
}
7070

7171
/// Full client dependencies.
72-
pub struct FullDeps<C, P, SC, Env> {
72+
pub struct FullDeps<C, P, SC, Env>
73+
where
74+
Env: voter::Environment<Block::Hash, NumberFor<Block>>,
75+
{
7376
/// The client instance to use.
7477
pub client: Arc<C>,
7578
/// Transaction pool instance.
@@ -80,15 +83,15 @@ pub struct FullDeps<C, P, SC, Env> {
8083
pub babe: BabeDeps,
8184
// WIP: sort out trait dependencies
8285
pub shared_voter_state: SharedVoterState<
83-
<Block as BlockT>::Hash,
86+
Block::Hash,
8487
NumberFor<Block>,
8588
Env,
8689
>,
8790
}
8891

8992
/// Instantiate all Full RPC extensions.
90-
pub fn create_full<C, P, M, SC>(
91-
deps: FullDeps<C, P, SC>,
93+
pub fn create_full<C, P, M, SC, Env>(
94+
deps: FullDeps<C, P, SC, Env>,
9295
) -> jsonrpc_core::IoHandler<M> where
9396
C: ProvideRuntimeApi<Block>,
9497
C: HeaderBackend<Block> + HeaderMetadata<Block, Error=BlockChainError> + 'static,
@@ -101,6 +104,7 @@ pub fn create_full<C, P, M, SC>(
101104
P: TransactionPool + 'static,
102105
M: jsonrpc_core::Metadata + Default,
103106
SC: SelectChain<Block> +'static,
107+
Env: voter::Environment<<Block as BlockT>::Hash, NumberFor<Block>> + Send + Sync,
104108
{
105109
use substrate_frame_rpc_system::{FullSystem, SystemApi};
106110
use pallet_contracts_rpc::{Contracts, ContractsApi};

0 commit comments

Comments
 (0)