mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 23:21:06 +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,7 +6,7 @@ edition = "2018"
|
||||
description = "Provides facilities for generating application specific crypto wrapper types."
|
||||
|
||||
[dependencies]
|
||||
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"] }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
sp-std = { path = "../std", default-features = false }
|
||||
@@ -14,11 +14,11 @@ sp-io = { path = "../../primitives/io", default-features = false }
|
||||
|
||||
[features]
|
||||
default = [ "std" ]
|
||||
std = [ "full_crypto", "primitives/std", "codec/std", "serde", "sp-std/std", "sp-io/std" ]
|
||||
std = [ "full_crypto", "sp-core/std", "codec/std", "serde", "sp-std/std", "sp-io/std" ]
|
||||
|
||||
# This feature enables all crypto primitives for `no_std` builds like microcontrollers
|
||||
# or Intel SGX.
|
||||
# For the regular wasm runtime builds this should not be used.
|
||||
full_crypto = [
|
||||
"primitives/full_crypto"
|
||||
"sp-core/full_crypto"
|
||||
]
|
||||
|
||||
@@ -20,10 +20,10 @@ use crate::{RuntimePublic, KeyTypeId};
|
||||
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
pub use primitives::ed25519::*;
|
||||
pub use sp_core::ed25519::*;
|
||||
|
||||
mod app {
|
||||
use primitives::testing::ED25519;
|
||||
use sp_core::testing::ED25519;
|
||||
crate::app_crypto!(super, ED25519);
|
||||
|
||||
impl crate::traits::BoundToRuntimeAppPublic for Public {
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use primitives::{self, crypto::{CryptoType, Public, Derive, IsWrappedBy, Wraps}, RuntimeDebug};
|
||||
pub use sp_core::{self, crypto::{CryptoType, Public, Derive, IsWrappedBy, Wraps}, RuntimeDebug};
|
||||
#[doc(hidden)]
|
||||
#[cfg(feature = "full_crypto")]
|
||||
pub use primitives::crypto::{SecretStringError, DeriveJunction, Ss58Codec, Pair};
|
||||
pub use primitives::{crypto::{KeyTypeId, key_types}};
|
||||
pub use sp_core::crypto::{SecretStringError, DeriveJunction, Ss58Codec, Pair};
|
||||
pub use sp_core::{crypto::{KeyTypeId, key_types}};
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use codec;
|
||||
|
||||
@@ -20,10 +20,10 @@ use crate::{RuntimePublic, KeyTypeId};
|
||||
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
pub use primitives::sr25519::*;
|
||||
pub use sp_core::sr25519::*;
|
||||
|
||||
mod app {
|
||||
use primitives::testing::SR25519;
|
||||
use sp_core::testing::SR25519;
|
||||
crate::app_crypto!(super, SR25519);
|
||||
|
||||
impl crate::traits::BoundToRuntimeAppPublic for Public {
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#[cfg(feature = "full_crypto")]
|
||||
use primitives::crypto::Pair;
|
||||
use sp_core::crypto::Pair;
|
||||
|
||||
use codec::Codec;
|
||||
use primitives::crypto::{KeyTypeId, CryptoType, IsWrappedBy, Public};
|
||||
use sp_core::crypto::{KeyTypeId, CryptoType, IsWrappedBy, Public};
|
||||
use sp_std::{fmt::Debug, vec::Vec};
|
||||
|
||||
/// An application-specific key.
|
||||
|
||||
@@ -7,6 +7,7 @@ description = "Integration tests for application-crypto"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
primitives = { package = "sp-core", path = "../../core", default-features = false }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../../test-utils/runtime/client" }
|
||||
sp-runtime = { path = "../../runtime" }
|
||||
sp-core = { path = "../../core", default-features = false }
|
||||
substrate-test-runtime-client = { path = "../../../test-utils/runtime/client" }
|
||||
sp-runtime = { path = "../../runtime" }
|
||||
sp-application-crypto = { path = "../" }
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
//! Integration tests for ed25519
|
||||
|
||||
use sp_runtime::{generic::BlockId, traits::ProvideRuntimeApi};
|
||||
use primitives::{testing::{KeyStore, ED25519}, crypto::Pair};
|
||||
use test_client::{
|
||||
use sp_core::{testing::{KeyStore, ED25519}, crypto::Pair};
|
||||
use substrate_test_runtime_client::{
|
||||
TestClientBuilder, DefaultTestClientBuilderExt, TestClientBuilderExt,
|
||||
runtime::{TestAPI, app_crypto::ed25519::{AppPair, AppPublic}},
|
||||
runtime::TestAPI,
|
||||
};
|
||||
use sp_application_crypto::ed25519::{AppPair, AppPublic};
|
||||
|
||||
#[test]
|
||||
fn ed25519_works_in_runtime() {
|
||||
@@ -35,4 +36,4 @@ fn ed25519_works_in_runtime() {
|
||||
.expect("There should be at a `ed25519` key in the keystore for the given public key.");
|
||||
|
||||
assert!(AppPair::verify(&signature, "ed25519", &AppPublic::from(key_pair.public())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
|
||||
|
||||
use sp_runtime::{generic::BlockId, traits::ProvideRuntimeApi};
|
||||
use primitives::{testing::{KeyStore, SR25519}, crypto::Pair};
|
||||
use test_client::{
|
||||
use sp_core::{testing::{KeyStore, SR25519}, crypto::Pair};
|
||||
use substrate_test_runtime_client::{
|
||||
TestClientBuilder, DefaultTestClientBuilderExt, TestClientBuilderExt,
|
||||
runtime::{TestAPI, app_crypto::sr25519::{AppPair, AppPublic}},
|
||||
runtime::TestAPI,
|
||||
};
|
||||
use sp_application_crypto::sr25519::{AppPair, AppPublic};
|
||||
|
||||
#[test]
|
||||
fn sr25519_works_in_runtime() {
|
||||
@@ -36,4 +37,4 @@ fn sr25519_works_in_runtime() {
|
||||
.expect("There should be at a `sr25519` key in the keystore for the given public key.");
|
||||
|
||||
assert!(AppPair::verify(&signature, "sr25519", &AppPublic::from(key_pair.public())));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user