mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 10:31:04 +00:00
Move non runtime related stuff into node/primitives (#2743)
* Remove stuff out of the runtime that does not belong there. There might be more, but it is a start. * White space fixes. * Fix tests. * Leave whitespace in ui tests alone. * Add back zstd for no reason. * Fix browser wasm (hopefully)
This commit is contained in:
@@ -13,6 +13,7 @@ polkadot-erasure-coding = { path = "../../../erasure-coding" }
|
||||
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
|
||||
polkadot-node-network-protocol = { path = "../../network/protocol" }
|
||||
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
|
||||
polkadot-node-primitives = { path = "../../primitives" }
|
||||
polkadot-node-core-runtime-api = { path = "../../core/runtime-api" }
|
||||
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] }
|
||||
|
||||
@@ -23,7 +23,8 @@ use thiserror::Error;
|
||||
use futures::channel::oneshot;
|
||||
|
||||
use polkadot_node_subsystem_util::Error as UtilError;
|
||||
use polkadot_primitives::v1::{CompressedPoVError, SessionIndex};
|
||||
use polkadot_primitives::v1::SessionIndex;
|
||||
use polkadot_node_primitives::CompressedPoVError;
|
||||
use polkadot_subsystem::{errors::RuntimeApiError, SubsystemError};
|
||||
|
||||
use crate::LOG_TARGET;
|
||||
|
||||
@@ -26,8 +26,9 @@ use polkadot_node_network_protocol::{
|
||||
v1::{PoVFetchingRequest, PoVFetchingResponse}}
|
||||
};
|
||||
use polkadot_primitives::v1::{
|
||||
AuthorityDiscoveryId, CandidateHash, Hash, PoV, SessionIndex, ValidatorIndex
|
||||
AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, ValidatorIndex
|
||||
};
|
||||
use polkadot_node_primitives::PoV;
|
||||
use polkadot_subsystem::{
|
||||
ActiveLeavesUpdate, SubsystemContext, ActivatedLeaf,
|
||||
messages::{AllMessages, NetworkBridgeMessage, IfDisconnected}
|
||||
@@ -241,7 +242,8 @@ mod tests {
|
||||
use parity_scale_codec::Encode;
|
||||
use sp_core::testing::TaskExecutor;
|
||||
|
||||
use polkadot_primitives::v1::{BlockData, CandidateHash, CompressedPoV, Hash, ValidatorIndex};
|
||||
use polkadot_primitives::v1::{CandidateHash, Hash, ValidatorIndex};
|
||||
use polkadot_node_primitives::{BlockData, CompressedPoV};
|
||||
use polkadot_subsystem_testhelpers as test_helpers;
|
||||
use polkadot_subsystem::messages::{AvailabilityDistributionMessage, RuntimeApiMessage, RuntimeApiRequest};
|
||||
|
||||
|
||||
@@ -27,9 +27,10 @@ use polkadot_node_network_protocol::request_response::{
|
||||
v1::{ChunkFetchingRequest, ChunkFetchingResponse},
|
||||
};
|
||||
use polkadot_primitives::v1::{
|
||||
AuthorityDiscoveryId, BlakeTwo256, ErasureChunk, GroupIndex, Hash, HashT, OccupiedCore,
|
||||
AuthorityDiscoveryId, BlakeTwo256, GroupIndex, Hash, HashT, OccupiedCore,
|
||||
SessionIndex,
|
||||
};
|
||||
use polkadot_node_primitives::ErasureChunk;
|
||||
use polkadot_subsystem::messages::{
|
||||
AllMessages, AvailabilityStoreMessage, NetworkBridgeMessage, IfDisconnected,
|
||||
};
|
||||
|
||||
@@ -26,7 +26,8 @@ use futures::task::{Poll, Context, noop_waker};
|
||||
use sc_network as network;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
|
||||
use polkadot_primitives::v1::{BlockData, CandidateHash, PoV, ValidatorIndex};
|
||||
use polkadot_primitives::v1::{CandidateHash, ValidatorIndex};
|
||||
use polkadot_node_primitives::{BlockData, PoV};
|
||||
use polkadot_node_network_protocol::request_response::v1;
|
||||
use polkadot_node_network_protocol::request_response::Recipient;
|
||||
use polkadot_subsystem::messages::AllMessages;
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
use futures::channel::oneshot;
|
||||
|
||||
use polkadot_node_network_protocol::request_response::{request::IncomingRequest, v1};
|
||||
use polkadot_primitives::v1::{AvailableData, CandidateHash, CompressedPoV, ErasureChunk, ValidatorIndex};
|
||||
use polkadot_primitives::v1::{CandidateHash, ValidatorIndex};
|
||||
use polkadot_node_primitives::{AvailableData, CompressedPoV, ErasureChunk};
|
||||
use polkadot_subsystem::{
|
||||
messages::{AllMessages, AvailabilityStoreMessage},
|
||||
SubsystemContext, jaeger,
|
||||
|
||||
@@ -25,10 +25,11 @@ use sp_application_crypto::AppKey;
|
||||
|
||||
use polkadot_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks};
|
||||
use polkadot_primitives::v1::{
|
||||
AvailableData, BlockData, CandidateCommitments, CandidateDescriptor, CandidateHash,
|
||||
CommittedCandidateReceipt, ErasureChunk, GroupIndex, Hash, HeadData, Id as ParaId,
|
||||
OccupiedCore, PersistedValidationData, PoV, SessionInfo, ValidatorId, ValidatorIndex
|
||||
CandidateCommitments, CandidateDescriptor, CandidateHash,
|
||||
CommittedCandidateReceipt, GroupIndex, Hash, HeadData, Id as ParaId,
|
||||
OccupiedCore, PersistedValidationData, SessionInfo, ValidatorId, ValidatorIndex
|
||||
};
|
||||
use polkadot_node_primitives::{PoV, ErasureChunk, AvailableData, BlockData};
|
||||
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
|
||||
|
||||
/// Get mock keystore with `Ferdie` key.
|
||||
|
||||
@@ -35,11 +35,13 @@ use polkadot_subsystem::{ActiveLeavesUpdate, FromOverseer, OverseerSignal, Activ
|
||||
RuntimeApiMessage, RuntimeApiRequest,
|
||||
}
|
||||
};
|
||||
use polkadot_primitives::v1::{CandidateHash, CoreState, ErasureChunk, GroupIndex, Hash, Id
|
||||
use polkadot_primitives::v1::{CandidateHash, CoreState, GroupIndex, Hash, Id
|
||||
as ParaId, ScheduledCore, SessionInfo,
|
||||
ValidatorIndex
|
||||
};
|
||||
use polkadot_node_network_protocol::{jaeger,
|
||||
use polkadot_node_primitives::ErasureChunk;
|
||||
use polkadot_node_network_protocol::{
|
||||
jaeger,
|
||||
request_response::{IncomingRequest, OutgoingRequest, Requests, v1}
|
||||
};
|
||||
use polkadot_subsystem_testhelpers as test_helpers;
|
||||
|
||||
@@ -13,6 +13,7 @@ tracing = "0.1.25"
|
||||
|
||||
polkadot-erasure-coding = { path = "../../../erasure-coding" }
|
||||
polkadot-primitives = { path = "../../../primitives" }
|
||||
polkadot-node-primitives = { path = "../../primitives" }
|
||||
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
|
||||
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
|
||||
polkadot-node-network-protocol = { path = "../../network/protocol" }
|
||||
|
||||
@@ -26,10 +26,11 @@ use lru::LruCache;
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
use polkadot_primitives::v1::{
|
||||
AuthorityDiscoveryId, AvailableData, CandidateReceipt, CandidateHash,
|
||||
Hash, ErasureChunk, ValidatorId, ValidatorIndex,
|
||||
AuthorityDiscoveryId, CandidateReceipt, CandidateHash,
|
||||
Hash, ValidatorId, ValidatorIndex,
|
||||
SessionInfo, SessionIndex, BlakeTwo256, HashT, GroupIndex, BlockNumber,
|
||||
};
|
||||
use polkadot_node_primitives::{ErasureChunk, AvailableData};
|
||||
use polkadot_subsystem::{
|
||||
SubsystemContext, SubsystemResult, SubsystemError, Subsystem, SpawnedSubsystem, FromOverseer,
|
||||
OverseerSignal, ActiveLeavesUpdate,
|
||||
|
||||
@@ -27,8 +27,9 @@ use parity_scale_codec::Encode;
|
||||
use super::*;
|
||||
|
||||
use polkadot_primitives::v1::{
|
||||
AuthorityDiscoveryId, PersistedValidationData, PoV, BlockData, HeadData,
|
||||
AuthorityDiscoveryId, PersistedValidationData, HeadData,
|
||||
};
|
||||
use polkadot_node_primitives::{PoV, BlockData};
|
||||
use polkadot_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks};
|
||||
use polkadot_node_subsystem_util::TimeoutExt;
|
||||
use polkadot_subsystem_testhelpers as test_helpers;
|
||||
|
||||
@@ -22,8 +22,8 @@ use futures::{select, FutureExt, channel::oneshot};
|
||||
use sp_core::Pair;
|
||||
|
||||
use polkadot_primitives::v1::{
|
||||
CandidateHash, CandidateReceipt, CollatorPair, CompressedPoV, CoreIndex, CoreState, Hash,
|
||||
Id as ParaId, PoV, ValidatorId
|
||||
CandidateHash, CandidateReceipt, CollatorPair, CoreIndex, CoreState, Hash,
|
||||
Id as ParaId, ValidatorId
|
||||
};
|
||||
use polkadot_subsystem::{
|
||||
jaeger, PerLeafSpan,
|
||||
@@ -42,7 +42,7 @@ use polkadot_node_subsystem_util::{
|
||||
request_availability_cores_ctx,
|
||||
metrics::{self, prometheus},
|
||||
};
|
||||
use polkadot_node_primitives::{SignedFullStatement, Statement};
|
||||
use polkadot_node_primitives::{SignedFullStatement, Statement, PoV, CompressedPoV};
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct Metrics(Option<MetricsInner>);
|
||||
@@ -949,9 +949,10 @@ mod tests {
|
||||
};
|
||||
use polkadot_node_subsystem_util::TimeoutExt;
|
||||
use polkadot_primitives::v1::{
|
||||
AuthorityDiscoveryId, BlockData, CandidateDescriptor, CollatorPair, GroupRotationInfo,
|
||||
AuthorityDiscoveryId, CandidateDescriptor, CollatorPair, GroupRotationInfo,
|
||||
ScheduledCore, SessionIndex, SessionInfo, ValidatorIndex,
|
||||
};
|
||||
use polkadot_node_primitives::BlockData;
|
||||
use polkadot_subsystem::{
|
||||
jaeger,
|
||||
messages::{RuntimeApiMessage, RuntimeApiRequest},
|
||||
|
||||
@@ -32,9 +32,9 @@ use polkadot_node_network_protocol::{
|
||||
},
|
||||
OurView, PeerId, UnifiedReputationChange as Rep, View,
|
||||
};
|
||||
use polkadot_node_primitives::{SignedFullStatement, Statement};
|
||||
use polkadot_node_primitives::{SignedFullStatement, Statement, PoV};
|
||||
use polkadot_node_subsystem_util::metrics::{self, prometheus};
|
||||
use polkadot_primitives::v1::{CandidateReceipt, CollatorId, Hash, Id as ParaId, PoV};
|
||||
use polkadot_primitives::v1::{CandidateReceipt, CollatorId, Hash, Id as ParaId};
|
||||
use polkadot_subsystem::{
|
||||
jaeger,
|
||||
messages::{
|
||||
@@ -896,7 +896,8 @@ mod tests {
|
||||
use sp_core::{crypto::Pair, Encode};
|
||||
use assert_matches::assert_matches;
|
||||
|
||||
use polkadot_primitives::v1::{BlockData, CollatorPair, CompressedPoV};
|
||||
use polkadot_primitives::v1::CollatorPair;
|
||||
use polkadot_node_primitives::{BlockData, CompressedPoV};
|
||||
use polkadot_subsystem_testhelpers as test_helpers;
|
||||
use polkadot_node_network_protocol::{our_view, ObservedRole,
|
||||
request_response::Requests
|
||||
|
||||
@@ -122,12 +122,12 @@ impl<T> Index<PeerSet> for PerPeerSet<T> {
|
||||
}
|
||||
|
||||
impl<T> IndexMut<PeerSet> for PerPeerSet<T> {
|
||||
fn index_mut(&mut self, index: PeerSet) -> &mut T {
|
||||
match index {
|
||||
fn index_mut(&mut self, index: PeerSet) -> &mut T {
|
||||
match index {
|
||||
PeerSet::Validation => &mut self.validation,
|
||||
PeerSet::Collation => &mut self.collation,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Get `NonDefaultSetConfig`s for all available peer sets.
|
||||
|
||||
@@ -36,7 +36,7 @@ use std::borrow::Cow;
|
||||
use std::time::Duration;
|
||||
|
||||
use futures::channel::mpsc;
|
||||
use polkadot_primitives::v1::MAX_COMPRESSED_POV_SIZE;
|
||||
use polkadot_node_primitives::MAX_COMPRESSED_POV_SIZE;
|
||||
use strum::EnumIter;
|
||||
|
||||
pub use sc_network::config as network;
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
|
||||
use polkadot_primitives::v1::{
|
||||
AvailableData, CandidateHash, CandidateReceipt, ErasureChunk, ValidatorIndex,
|
||||
CompressedPoV, Hash,
|
||||
CandidateHash, CandidateReceipt, ValidatorIndex,
|
||||
Hash,
|
||||
};
|
||||
use polkadot_primitives::v1::Id as ParaId;
|
||||
use polkadot_node_primitives::{AvailableData, CompressedPoV, ErasureChunk};
|
||||
|
||||
use super::request::IsRequest;
|
||||
use super::Protocol;
|
||||
|
||||
Reference in New Issue
Block a user