mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 20:35:41 +00:00
* Add sync_state_items * Add SyncStateRpc * "Update Substrate" Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -14,6 +14,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master"}
|
||||
sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate", branch = "master"}
|
||||
@@ -21,6 +22,7 @@ sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch
|
||||
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master"}
|
||||
sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "master"}
|
||||
txpool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
+19
-6
@@ -28,9 +28,11 @@ use sp_blockchain::{HeaderBackend, HeaderMetadata, Error as BlockChainError};
|
||||
use sp_consensus::SelectChain;
|
||||
use sp_consensus_babe::BabeApi;
|
||||
use sp_keystore::SyncCryptoStorePtr;
|
||||
use sc_client_api::AuxStore;
|
||||
use sc_client_api::light::{Fetcher, RemoteBlockchain};
|
||||
use sc_consensus_babe::Epoch;
|
||||
use sc_finality_grandpa::FinalityProofProvider;
|
||||
use sc_sync_state_rpc::{SyncStateRpcApi, SyncStateRpcHandler};
|
||||
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
|
||||
|
||||
/// A type representing all RPC extensions.
|
||||
@@ -80,6 +82,8 @@ pub struct FullDeps<C, P, SC, B> {
|
||||
pub pool: Arc<P>,
|
||||
/// The SelectChain Strategy
|
||||
pub select_chain: SC,
|
||||
/// A copy of the chain spec.
|
||||
pub chain_spec: Box<dyn sc_chain_spec::ChainSpec>,
|
||||
/// Whether to deny unsafe calls
|
||||
pub deny_unsafe: DenyUnsafe,
|
||||
/// BABE specific dependencies.
|
||||
@@ -90,9 +94,8 @@ pub struct FullDeps<C, P, SC, B> {
|
||||
|
||||
/// Instantiate all RPC extensions.
|
||||
pub fn create_full<C, P, SC, B>(deps: FullDeps<C, P, SC, B>) -> RpcExtension where
|
||||
C: ProvideRuntimeApi<Block>,
|
||||
C: HeaderBackend<Block> + HeaderMetadata<Block, Error=BlockChainError>,
|
||||
C: Send + Sync + 'static,
|
||||
C: ProvideRuntimeApi<Block> + HeaderBackend<Block> + AuxStore +
|
||||
HeaderMetadata<Block, Error=BlockChainError> + Send + Sync + 'static,
|
||||
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: BabeApi<Block>,
|
||||
@@ -112,6 +115,7 @@ pub fn create_full<C, P, SC, B>(deps: FullDeps<C, P, SC, B>) -> RpcExtension whe
|
||||
client,
|
||||
pool,
|
||||
select_chain,
|
||||
chain_spec,
|
||||
deny_unsafe,
|
||||
babe,
|
||||
grandpa,
|
||||
@@ -138,8 +142,8 @@ pub fn create_full<C, P, SC, B>(deps: FullDeps<C, P, SC, B>) -> RpcExtension whe
|
||||
io.extend_with(
|
||||
sc_consensus_babe_rpc::BabeApi::to_delegate(
|
||||
BabeRpcHandler::new(
|
||||
client,
|
||||
shared_epoch_changes,
|
||||
client.clone(),
|
||||
shared_epoch_changes.clone(),
|
||||
keystore,
|
||||
babe_config,
|
||||
select_chain,
|
||||
@@ -149,13 +153,22 @@ pub fn create_full<C, P, SC, B>(deps: FullDeps<C, P, SC, B>) -> RpcExtension whe
|
||||
);
|
||||
io.extend_with(
|
||||
GrandpaApi::to_delegate(GrandpaRpcHandler::new(
|
||||
shared_authority_set,
|
||||
shared_authority_set.clone(),
|
||||
shared_voter_state,
|
||||
justification_stream,
|
||||
subscription_executor,
|
||||
finality_provider,
|
||||
))
|
||||
);
|
||||
io.extend_with(
|
||||
SyncStateRpcApi::to_delegate(SyncStateRpcHandler::new(
|
||||
chain_spec,
|
||||
client,
|
||||
shared_authority_set,
|
||||
shared_epoch_changes,
|
||||
deny_unsafe,
|
||||
))
|
||||
);
|
||||
io
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user