Companion for substrate#11469 (#5569)

* Comanion for substrate#11469

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Remove extra Rpc naming in the structs

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update Substrate

Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Qinxuan Chen
2022-05-21 16:37:55 +08:00
committed by GitHub
parent 5409510510
commit e4f6f8d76a
2 changed files with 188 additions and 192 deletions
+172 -172
View File
File diff suppressed because it is too large Load Diff
+16 -20
View File
@@ -115,14 +115,14 @@ where
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
B::State: sc_client_api::StateBackend<sp_runtime::traits::HashFor<Block>>,
{
use beefy_gadget_rpc::{BeefyApiServer, BeefyRpcHandler};
use frame_rpc_system::{SystemApiServer, SystemRpc};
use pallet_mmr_rpc::{MmrApiServer, MmrRpc};
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
use sc_consensus_babe_rpc::{BabeApiServer, BabeRpc};
use sc_finality_grandpa_rpc::{GrandpaApiServer, GrandpaRpc};
use sc_sync_state_rpc::{SyncStateRpc, SyncStateRpcApiServer};
use substrate_state_trie_migration_rpc::StateMigrationApiServer;
use beefy_gadget_rpc::{Beefy, BeefyApiServer};
use frame_rpc_system::{System, SystemApiServer};
use pallet_mmr_rpc::{Mmr, MmrApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use sc_consensus_babe_rpc::{Babe, BabeApiServer};
use sc_finality_grandpa_rpc::{Grandpa, GrandpaApiServer};
use sc_sync_state_rpc::{SyncState, SyncStateApiServer};
use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer};
let mut io = RpcModule::new(());
let FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa, beefy } =
@@ -136,15 +136,12 @@ where
finality_provider,
} = grandpa;
io.merge(StateMigration::new(client.clone(), backend, deny_unsafe).into_rpc())?;
io.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
io.merge(Mmr::new(client.clone()).into_rpc())?;
io.merge(
substrate_state_trie_migration_rpc::MigrationRpc::new(client.clone(), backend, deny_unsafe)
.into_rpc(),
)?;
io.merge(SystemRpc::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
io.merge(TransactionPaymentRpc::new(client.clone()).into_rpc())?;
io.merge(MmrRpc::new(client.clone()).into_rpc())?;
io.merge(
BabeRpc::new(
Babe::new(
client.clone(),
shared_epoch_changes.clone(),
keystore,
@@ -155,7 +152,7 @@ where
.into_rpc(),
)?;
io.merge(
GrandpaRpc::new(
Grandpa::new(
subscription_executor,
shared_authority_set.clone(),
shared_voter_state,
@@ -165,12 +162,11 @@ where
.into_rpc(),
)?;
io.merge(
SyncStateRpc::new(chain_spec, client, shared_authority_set, shared_epoch_changes)?
.into_rpc(),
SyncState::new(chain_spec, client, shared_authority_set, shared_epoch_changes)?.into_rpc(),
)?;
io.merge(
BeefyRpcHandler::<Block>::new(
Beefy::<Block>::new(
beefy.beefy_commitment_stream,
beefy.beefy_best_block_stream,
beefy.subscription_executor,