Add trie migration rpc to polkadot-parachain (#1424)

* add trie migration rpc to polkadot-parachain

* pass backend

* fix
This commit is contained in:
cheme
2022-11-07 11:41:45 +01:00
committed by GitHub
parent 368cef5fea
commit 167eb516d8
4 changed files with 11 additions and 3 deletions
+7 -2
View File
@@ -42,8 +42,9 @@ pub struct FullDeps<C, P> {
}
/// Instantiate all RPC extensions.
pub fn create_full<C, P>(
pub fn create_full<C, P, B>(
deps: FullDeps<C, P>,
backend: Arc<B>,
) -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>>
where
C: ProvideRuntimeApi<Block>
@@ -57,15 +58,19 @@ where
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
P: TransactionPool + Sync + Send + 'static,
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,
{
use frame_rpc_system::{System, SystemApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer};
let mut module = RpcExtension::new(());
let FullDeps { client, pool, deny_unsafe } = deps;
module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(TransactionPayment::new(client).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
module.merge(StateMigration::new(client.clone(), backend, deny_unsafe).into_rpc())?;
Ok(module)
}