Instantiate all Full RPC extensions.
(deps: FullDeps<C, P, SC, B>)
| 100 | |
| 101 | /// Instantiate all Full RPC extensions. |
| 102 | pub fn create_full<C, P, SC, B>(deps: FullDeps<C, P, SC, B>) -> jsonrpc_core::IoHandler<sc_rpc_api::Metadata> |
| 103 | where |
| 104 | C: ProvideRuntimeApi<Block> |
| 105 | + HeaderBackend<Block> |
| 106 | + AuxStore |
| 107 | + HeaderMetadata<Block, Error = BlockChainError> |
| 108 | + Sync |
| 109 | + Send |
| 110 | + 'static, |
| 111 | C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>, |
| 112 | C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>, |
| 113 | C::Api: BabeApi<Block>, |
| 114 | C::Api: BlockBuilder<Block>, |
| 115 | P: TransactionPool + 'static, |
| 116 | SC: SelectChain<Block> + 'static, |
| 117 | B: sc_client_api::Backend<Block> + Send + Sync + 'static, |
| 118 | B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>, |
| 119 | // TODO |
| 120 | // C::Api: orml_oracle_rpc::OracleRuntimeApi<Block, CurrencyId, TimeStampedPrice>, |
| 121 | // <C::Api as sp_api::ApiErrorExt>::Error: fmt::Debug, |
| 122 | // M: jsonrpc_core::Metadata + Default, |
| 123 | { |
| 124 | // TODO |
| 125 | // use orml_oracle_rpc::{Oracle, OracleApi}; |
| 126 | use pallet_transaction_payment_rpc::{ |
| 127 | TransactionPayment, |
| 128 | TransactionPaymentApi, |
| 129 | }; |
| 130 | use substrate_frame_rpc_system::{ |
| 131 | FullSystem, |
| 132 | SystemApi, |
| 133 | }; |
| 134 | |
| 135 | let mut io = jsonrpc_core::IoHandler::default(); |
| 136 | let FullDeps { |
| 137 | client, |
| 138 | pool, |
| 139 | select_chain, |
| 140 | chain_spec, |
| 141 | deny_unsafe, |
| 142 | babe, |
| 143 | grandpa, |
| 144 | } = deps; |
| 145 | |
| 146 | let BabeDeps { |
| 147 | keystore, |
| 148 | babe_config, |
| 149 | shared_epoch_changes, |
| 150 | } = babe; |
| 151 | let GrandpaDeps { |
| 152 | shared_voter_state, |
| 153 | shared_authority_set, |
| 154 | justification_stream, |
| 155 | subscription_executor, |
| 156 | finality_provider, |
| 157 | } = grandpa; |
| 158 | |
| 159 | io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))); // TODO#ILYA |