mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 23:01:01 +00:00
[big refactor] Remove crate aliasing. (#4395)
* Rename: Phase 1. * Unify codec. * Fixing: Phase 2 * Fixing: Phase 3. * Fixing: Phase 4. * Fixing: Phase 5. * Fixing: Phase 6. * Fixing: Phase 7. * Fixing: Phase 8. Tests * Fixing: Phase 9. Tests!!! * Fixing: Phase 10. Moar tests! * Finally done! * More fixes. * Rename primitives:: to sp_core:: * Apply renames in finality-grandpa. * Fix benches. * Fix benches 2. * Revert node-template. * Fix frame-system in our modules.
This commit is contained in:
committed by
Gavin Wood
parent
f14d98a439
commit
8778ca7dc8
@@ -6,22 +6,22 @@ description = "Primitives for Aura consensus"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
app-crypto = { package = "sp-application-crypto", path = "../../application-crypto", default-features = false }
|
||||
sp-application-crypto = { path = "../../application-crypto", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
|
||||
sp-std = { path = "../../std", default-features = false }
|
||||
sp-api = { path = "../../api", default-features = false }
|
||||
sp-runtime = { path = "../../runtime", default-features = false }
|
||||
inherents = { package = "sp-inherents", path = "../../inherents", default-features = false }
|
||||
sp-inherents = { path = "../../inherents", default-features = false }
|
||||
sp-timestamp = { path = "../../timestamp", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"app-crypto/std",
|
||||
"sp-application-crypto/std",
|
||||
"codec/std",
|
||||
"sp-std/std",
|
||||
"sp-api/std",
|
||||
"sp-runtime/std",
|
||||
"inherents/std",
|
||||
"sp-inherents/std",
|
||||
"sp-timestamp/std",
|
||||
]
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
/// Contains the inherents for the AURA module
|
||||
|
||||
use inherents::{InherentIdentifier, InherentData, Error};
|
||||
use sp_inherents::{InherentIdentifier, InherentData, Error};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use inherents::{InherentDataProviders, ProvideInherentData};
|
||||
use sp_inherents::{InherentDataProviders, ProvideInherentData};
|
||||
|
||||
/// The Aura inherent identifier.
|
||||
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"auraslot";
|
||||
@@ -93,6 +93,6 @@ impl ProvideInherentData for InherentDataProvider {
|
||||
fn error_to_string(&self, error: &[u8]) -> Option<String> {
|
||||
use codec::Decode;
|
||||
|
||||
inherents::Error::decode(&mut &error[..]).map(|e| e.into_string()).ok()
|
||||
sp_inherents::Error::decode(&mut &error[..]).map(|e| e.into_string()).ok()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ pub mod inherents;
|
||||
|
||||
pub mod sr25519 {
|
||||
mod app_sr25519 {
|
||||
use app_crypto::{app_crypto, key_types::AURA, sr25519};
|
||||
use sp_application_crypto::{app_crypto, key_types::AURA, sr25519};
|
||||
app_crypto!(sr25519, AURA);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ pub mod sr25519 {
|
||||
|
||||
pub mod ed25519 {
|
||||
mod app_ed25519 {
|
||||
use app_crypto::{app_crypto, key_types::AURA, ed25519};
|
||||
use sp_application_crypto::{app_crypto, key_types::AURA, ed25519};
|
||||
app_crypto!(ed25519, AURA);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,20 +6,20 @@ description = "Primitives for BABE consensus"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
app-crypto = { package = "sp-application-crypto", path = "../../application-crypto", default-features = false }
|
||||
sp-application-crypto = { path = "../../application-crypto", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
|
||||
sp-std = { path = "../../std", default-features = false }
|
||||
schnorrkel = { version = "0.8.5", features = ["preaudit_deprecated"], optional = true }
|
||||
sp-api = { path = "../../api", default-features = false }
|
||||
sp-consensus = { path = "../common", optional = true }
|
||||
sp-inherents = { package = "sp-inherents", path = "../../inherents", default-features = false }
|
||||
sp-inherents = { path = "../../inherents", default-features = false }
|
||||
sp-runtime = { path = "../../runtime", default-features = false }
|
||||
sp-timestamp = { path = "../../timestamp", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"app-crypto/std",
|
||||
"sp-application-crypto/std",
|
||||
"codec/std",
|
||||
"sp-std/std",
|
||||
"schnorrkel",
|
||||
|
||||
@@ -31,7 +31,7 @@ pub use digest::{BabePreDigest, CompatibleDigestItem};
|
||||
pub use digest::{BABE_VRF_PREFIX, RawBabePreDigest, NextEpochDescriptor};
|
||||
|
||||
mod app {
|
||||
use app_crypto::{app_crypto, key_types::BABE, sr25519};
|
||||
use sp_application_crypto::{app_crypto, key_types::BABE, sr25519};
|
||||
app_crypto!(sr25519, BABE);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@ edition = "2018"
|
||||
derive_more = "0.99.2"
|
||||
libp2p = { version = "0.13.0", default-features = false }
|
||||
log = "0.4.8"
|
||||
primitives = { package = "sp-core", path= "../../core" }
|
||||
inherents = { package = "sp-inherents", path = "../../inherents" }
|
||||
sp-core = { path= "../../core" }
|
||||
sp-inherents = { path = "../../inherents" }
|
||||
futures = { version = "0.3.1", features = ["thread-pool"] }
|
||||
futures-timer = "0.4.0"
|
||||
sp-std = { path = "../../std" }
|
||||
runtime_version = { package = "sp-version", path = "../../version" }
|
||||
sp-version = { path = "../../version" }
|
||||
sp-runtime = { path = "../../runtime" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", features = ["derive"] }
|
||||
parking_lot = "0.9.0"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Error types in Consensus
|
||||
use runtime_version::RuntimeVersion;
|
||||
use primitives::ed25519::{Public, Signature};
|
||||
use sp_version::RuntimeVersion;
|
||||
use sp_core::ed25519::{Public, Signature};
|
||||
use std::error;
|
||||
|
||||
/// Result type alias.
|
||||
@@ -36,7 +36,7 @@ pub enum Error {
|
||||
FaultyTimer(std::io::Error),
|
||||
/// Error while working with inherent data.
|
||||
#[display(fmt="InherentData error: {}", _0)]
|
||||
InherentData(inherents::Error),
|
||||
InherentData(sp_inherents::Error),
|
||||
/// Unable to propose a block.
|
||||
#[display(fmt="Unable to create block proposal.")]
|
||||
CannotPropose,
|
||||
|
||||
@@ -33,7 +33,7 @@ use std::time::Duration;
|
||||
|
||||
use sp_runtime::{traits::{Block as BlockT, DigestFor}, generic::BlockId};
|
||||
use futures::prelude::*;
|
||||
pub use inherents::InherentData;
|
||||
pub use sp_inherents::InherentData;
|
||||
|
||||
pub mod block_validation;
|
||||
pub mod offline_tracker;
|
||||
@@ -146,7 +146,7 @@ pub trait CanAuthorWith<Block: BlockT> {
|
||||
}
|
||||
|
||||
/// Checks if the node can author blocks by using
|
||||
/// [`NativeVersion::can_author_with`](runtime_version::NativeVersion::can_author_with).
|
||||
/// [`NativeVersion::can_author_with`](sp_version::NativeVersion::can_author_with).
|
||||
pub struct CanAuthorWithNativeVersion<T>(T);
|
||||
|
||||
impl<T> CanAuthorWithNativeVersion<T> {
|
||||
@@ -156,7 +156,7 @@ impl<T> CanAuthorWithNativeVersion<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: runtime_version::GetRuntimeVersion<Block>, Block: BlockT> CanAuthorWith<Block>
|
||||
impl<T: sp_version::GetRuntimeVersion<Block>, Block: BlockT> CanAuthorWith<Block>
|
||||
for CanAuthorWithNativeVersion<T>
|
||||
{
|
||||
fn can_author_with(&self, at: &BlockId<Block>) -> Result<(), String> {
|
||||
|
||||
@@ -9,7 +9,7 @@ edition = "2018"
|
||||
sp-api = { path = "../../api", default-features = false }
|
||||
sp-std = { path = "../../std", default-features = false }
|
||||
sp-runtime = { path = "../../runtime", default-features = false }
|
||||
primitives = { package = "sp-core", path = "../../core", default-features = false }
|
||||
sp-core = { path = "../../core", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
|
||||
|
||||
[features]
|
||||
@@ -18,6 +18,6 @@ std = [
|
||||
"sp-std/std",
|
||||
"sp-api/std",
|
||||
"sp-runtime/std",
|
||||
"primitives/std",
|
||||
"sp-core/std",
|
||||
"codec/std",
|
||||
]
|
||||
|
||||
@@ -33,7 +33,7 @@ pub trait TotalDifficulty {
|
||||
fn increment(&mut self, other: Self);
|
||||
}
|
||||
|
||||
impl TotalDifficulty for primitives::U256 {
|
||||
impl TotalDifficulty for sp_core::U256 {
|
||||
fn increment(&mut self, other: Self) {
|
||||
let ret = self.saturating_add(other);
|
||||
*self = ret;
|
||||
|
||||
Reference in New Issue
Block a user