mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 13:21:01 +00:00
Cleanup dependencies + dead code (#2302)
This commit is contained in:
@@ -17,15 +17,10 @@ polkadot-network-bridge = { git = "https://github.com/paritytech/polkadot", bran
|
||||
# substrate deps
|
||||
sc-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
@@ -42,5 +37,4 @@ lru = "0.9"
|
||||
tracing = "0.1.37"
|
||||
async-trait = "0.1.63"
|
||||
futures = "0.3.26"
|
||||
url = "2.2.2"
|
||||
tokio = { version = "1.25.0", features = ["macros"] }
|
||||
|
||||
@@ -19,13 +19,12 @@ use std::pin::Pin;
|
||||
use cumulus_relay_chain_interface::{RelayChainError, RelayChainResult};
|
||||
use cumulus_relay_chain_rpc_interface::RelayChainRpcClient;
|
||||
use futures::{Future, Stream, StreamExt};
|
||||
use polkadot_core_primitives::{Block, Hash, Header};
|
||||
use polkadot_core_primitives::{Block, BlockNumber, Hash, Header};
|
||||
use polkadot_overseer::RuntimeApiSubsystemClient;
|
||||
use polkadot_service::{AuxStore, HeaderBackend};
|
||||
use sc_authority_discovery::AuthorityDiscovery;
|
||||
|
||||
use sp_api::{ApiError, RuntimeApiInfo};
|
||||
use sp_blockchain::Info;
|
||||
use sp_blockchain::{HeaderBackend, Info};
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct BlockChainRpcClient {
|
||||
@@ -46,34 +45,12 @@ impl BlockChainRpcClient {
|
||||
|
||||
pub async fn block_get_hash(
|
||||
&self,
|
||||
number: Option<polkadot_service::BlockNumber>,
|
||||
number: Option<BlockNumber>,
|
||||
) -> Result<Option<Hash>, RelayChainError> {
|
||||
self.rpc_client.chain_get_block_hash(number).await
|
||||
}
|
||||
}
|
||||
|
||||
// Implementation required by Availability-Distribution subsystem
|
||||
// but never called in our case.
|
||||
impl AuxStore for BlockChainRpcClient {
|
||||
fn insert_aux<
|
||||
'a,
|
||||
'b: 'a,
|
||||
'c: 'a,
|
||||
I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>,
|
||||
D: IntoIterator<Item = &'a &'b [u8]>,
|
||||
>(
|
||||
&self,
|
||||
_insert: I,
|
||||
_delete: D,
|
||||
) -> sp_blockchain::Result<()> {
|
||||
unimplemented!("Not supported on the RPC collator")
|
||||
}
|
||||
|
||||
fn get_aux(&self, _key: &[u8]) -> sp_blockchain::Result<Option<Vec<u8>>> {
|
||||
unimplemented!("Not supported on the RPC collator")
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl RuntimeApiSubsystemClient for BlockChainRpcClient {
|
||||
async fn validators(
|
||||
@@ -359,8 +336,8 @@ fn block_local<T>(fut: impl Future<Output = T>) -> T {
|
||||
impl HeaderBackend<Block> for BlockChainRpcClient {
|
||||
fn header(
|
||||
&self,
|
||||
hash: <Block as polkadot_service::BlockT>::Hash,
|
||||
) -> sp_blockchain::Result<Option<<Block as polkadot_service::BlockT>::Header>> {
|
||||
hash: <Block as BlockT>::Hash,
|
||||
) -> sp_blockchain::Result<Option<<Block as BlockT>::Header>> {
|
||||
Ok(block_local(self.rpc_client.chain_get_header(Some(hash)))?)
|
||||
}
|
||||
|
||||
@@ -389,7 +366,7 @@ impl HeaderBackend<Block> for BlockChainRpcClient {
|
||||
|
||||
fn status(
|
||||
&self,
|
||||
hash: <Block as polkadot_service::BlockT>::Hash,
|
||||
hash: <Block as BlockT>::Hash,
|
||||
) -> sp_blockchain::Result<sp_blockchain::BlockStatus> {
|
||||
if self.header(hash)?.is_some() {
|
||||
Ok(sc_client_api::blockchain::BlockStatus::InChain)
|
||||
@@ -400,10 +377,8 @@ impl HeaderBackend<Block> for BlockChainRpcClient {
|
||||
|
||||
fn number(
|
||||
&self,
|
||||
hash: <Block as polkadot_service::BlockT>::Hash,
|
||||
) -> sp_blockchain::Result<
|
||||
Option<<<Block as polkadot_service::BlockT>::Header as polkadot_service::HeaderT>::Number>,
|
||||
> {
|
||||
hash: <Block as BlockT>::Hash,
|
||||
) -> sp_blockchain::Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>> {
|
||||
let result = block_local(self.rpc_client.chain_get_header(Some(hash)))?
|
||||
.map(|maybe_header| maybe_header.number);
|
||||
Ok(result)
|
||||
@@ -411,8 +386,8 @@ impl HeaderBackend<Block> for BlockChainRpcClient {
|
||||
|
||||
fn hash(
|
||||
&self,
|
||||
number: polkadot_service::NumberFor<Block>,
|
||||
) -> sp_blockchain::Result<Option<<Block as polkadot_service::BlockT>::Hash>> {
|
||||
number: NumberFor<Block>,
|
||||
) -> sp_blockchain::Result<Option<<Block as BlockT>::Hash>> {
|
||||
Ok(block_local(self.rpc_client.chain_get_block_hash(number.into()))?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use cumulus_relay_chain_interface::RelayChainError;
|
||||
use futures::{select, StreamExt};
|
||||
use lru::LruCache;
|
||||
use std::sync::Arc;
|
||||
|
||||
use polkadot_node_network_protocol::{
|
||||
peer_set::PeerSetProtocolNames,
|
||||
request_response::{
|
||||
@@ -25,8 +27,8 @@ use polkadot_node_network_protocol::{
|
||||
};
|
||||
use polkadot_node_subsystem_util::metrics::{prometheus::Registry, Metrics};
|
||||
use polkadot_overseer::{
|
||||
BlockInfo, DummySubsystem, MetricsTrait, Overseer, OverseerHandle, OverseerMetrics, SpawnGlue,
|
||||
KNOWN_LEAVES_CACHE_SIZE,
|
||||
BlockInfo, DummySubsystem, Handle, MetricsTrait, Overseer, OverseerHandle, OverseerMetrics,
|
||||
SpawnGlue, KNOWN_LEAVES_CACHE_SIZE,
|
||||
};
|
||||
use polkadot_primitives::CollatorPair;
|
||||
use polkadot_service::{
|
||||
@@ -37,18 +39,16 @@ use polkadot_service::{
|
||||
},
|
||||
Error, OverseerConnector,
|
||||
};
|
||||
|
||||
use sc_authority_discovery::Service as AuthorityDiscoveryService;
|
||||
use sc_network::NetworkStateInfo;
|
||||
|
||||
use std::sync::Arc;
|
||||
use sc_service::TaskManager;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
use cumulus_primitives_core::relay_chain::{Block, Hash as PHash};
|
||||
|
||||
use polkadot_service::{Handle, TaskManager};
|
||||
use cumulus_relay_chain_interface::RelayChainError;
|
||||
|
||||
use crate::BlockChainRpcClient;
|
||||
use futures::{select, StreamExt};
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
/// Arguments passed for overseer construction.
|
||||
pub(crate) struct CollatorOverseerGenArgs<'a> {
|
||||
|
||||
@@ -30,13 +30,11 @@ use polkadot_primitives::CollatorPair;
|
||||
use sc_authority_discovery::Service as AuthorityDiscoveryService;
|
||||
use sc_network::{Event, NetworkService};
|
||||
use sc_network_common::service::NetworkEventStream;
|
||||
use std::sync::Arc;
|
||||
|
||||
use polkadot_service::{Configuration, TaskManager};
|
||||
use sc_service::{Configuration, TaskManager};
|
||||
use sp_runtime::{app_crypto::Pair, traits::Block as BlockT};
|
||||
|
||||
use futures::StreamExt;
|
||||
|
||||
use sp_runtime::{app_crypto::Pair, traits::Block as BlockT};
|
||||
use std::sync::Arc;
|
||||
|
||||
mod collator_overseer;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use polkadot_core_primitives::{Block, Hash};
|
||||
use polkadot_service::{BlockT, NumberFor};
|
||||
use sp_runtime::traits::{Block as BlockT, NumberFor};
|
||||
|
||||
use sc_network::NetworkService;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user