[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:
Tomasz Drwięga
2019-12-16 13:36:49 +01:00
committed by Gavin Wood
parent f14d98a439
commit 8778ca7dc8
485 changed files with 4023 additions and 4005 deletions
+11 -11
View File
@@ -6,29 +6,29 @@ edition = "2018"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
consensus = { package = "sp-consensus", path = "../../primitives/consensus/common" }
sp-consensus = { path = "../../primitives/consensus/common" }
derive_more = { version = "0.99.2" }
executor = { package = "sc-executor", path = "../executor" }
externalities = { package = "sp-externalities", path = "../../primitives/externalities" }
sc-executor = { path = "../executor" }
sp-externalities = { path = "../../primitives/externalities" }
fnv = { version = "1.0.6" }
futures = { version = "0.3.1" }
hash-db = { version = "0.15.2", default-features = false }
sp-blockchain = { path = "../../primitives/blockchain" }
hex-literal = { version = "0.2.1" }
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
keyring = { package = "sp-keyring", path = "../../primitives/keyring" }
sp-inherents = { path = "../../primitives/inherents", default-features = false }
sp-keyring = { path = "../../primitives/keyring" }
kvdb = "0.1.1"
log = { version = "0.4.8" }
parking_lot = { version = "0.9.0" }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
sp-core = { path = "../../primitives/core", default-features = false }
sp-std = { path = "../../primitives/std", default-features = false }
runtime-version = { package = "sp-version", path = "../../primitives/version", default-features = false }
sp-version = { path = "../../primitives/version", default-features = false }
sp-api = { path = "../../primitives/api" }
sp-runtime = { path = "../../primitives/runtime", default-features = false }
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
sp-state-machine = { path = "../../primitives/state-machine" }
sc-telemetry = { path = "../telemetry" }
trie = { package = "sp-trie", path = "../../primitives/trie" }
txpool-api = { package = "sp-transaction-pool", path = "../../primitives/transaction-pool" }
sp-trie = { path = "../../primitives/trie" }
sp-transaction-pool = { path = "../../primitives/transaction-pool" }
[dev-dependencies]
test-primitives = { package = "sp-test-primitives", path = "../../primitives/test-primitives" }
sp-test-primitives = { path = "../../primitives/test-primitives" }
+5 -5
View File
@@ -18,12 +18,12 @@
use std::sync::Arc;
use std::collections::HashMap;
use primitives::ChangesTrieConfiguration;
use primitives::offchain::OffchainStorage;
use sp_core::ChangesTrieConfiguration;
use sp_core::offchain::OffchainStorage;
use sp_runtime::{generic::BlockId, Justification, Storage};
use sp_runtime::traits::{Block as BlockT, NumberFor};
use state_machine::backend::Backend as StateBackend;
use state_machine::{ChangesTrieStorage as StateChangesTrieStorage, ChangesTrieTransaction};
use sp_state_machine::backend::Backend as StateBackend;
use sp_state_machine::{ChangesTrieStorage as StateChangesTrieStorage, ChangesTrieTransaction};
use crate::{
blockchain::{
Backend as BlockchainBackend, well_known_cache_keys
@@ -31,7 +31,7 @@ use crate::{
light::RemoteBlockchain,
};
use sp_blockchain;
use consensus::BlockOrigin;
use sp_consensus::BlockOrigin;
use hash_db::Hasher;
use parking_lot::RwLock;
+11 -11
View File
@@ -21,14 +21,14 @@ use codec::{Encode, Decode};
use sp_runtime::{
generic::BlockId, traits::Block as BlockT, traits::NumberFor,
};
use state_machine::{
use sp_state_machine::{
self, OverlayedChanges, ExecutionManager, ExecutionStrategy,
ChangesTrieTransaction, StorageProof,
};
use executor::{RuntimeVersion, NativeVersion};
use externalities::Extensions;
use sc_executor::{RuntimeVersion, NativeVersion};
use sp_externalities::Extensions;
use hash_db::Hasher;
use primitives::{Blake2Hasher, NativeOrEncoded};
use sp_core::{Blake2Hasher, NativeOrEncoded};
use sp_api::{ProofRecorder, InitializeBlock};
use sp_blockchain;
@@ -41,7 +41,7 @@ where
H::Out: Ord,
{
/// Externalities error type.
type Error: state_machine::Error;
type Error: sp_state_machine::Error;
/// Execute a call to a contract on top of state in a block of given hash.
///
@@ -92,7 +92,7 @@ where
///
/// No changes are made.
fn call_at_state<
S: state_machine::Backend<H>,
S: sp_state_machine::Backend<H>,
F: FnOnce(
Result<NativeOrEncoded<R>, Self::Error>,
Result<NativeOrEncoded<R>, Self::Error>,
@@ -119,7 +119,7 @@ where
/// Execute a call to a contract on top of given state, gathering execution proof.
///
/// No changes are made.
fn prove_at_state<S: state_machine::Backend<H>>(
fn prove_at_state<S: sp_state_machine::Backend<H>>(
&self,
mut state: S,
overlay: &mut OverlayedChanges,
@@ -128,8 +128,8 @@ where
) -> Result<(Vec<u8>, StorageProof), sp_blockchain::Error> {
let trie_state = state.as_trie_backend()
.ok_or_else(||
Box::new(state_machine::ExecutionError::UnableToGenerateProof)
as Box<dyn state_machine::Error>
Box::new(sp_state_machine::ExecutionError::UnableToGenerateProof)
as Box<dyn sp_state_machine::Error>
)?;
self.prove_at_trie_state(trie_state, overlay, method, call_data)
}
@@ -137,9 +137,9 @@ where
/// Execute a call to a contract on top of given trie state, gathering execution proof.
///
/// No changes are made.
fn prove_at_trie_state<S: state_machine::TrieBackendStorage<H>>(
fn prove_at_trie_state<S: sp_state_machine::TrieBackendStorage<H>>(
&self,
trie_state: &state_machine::TrieBackend<S, H>,
trie_state: &sp_state_machine::TrieBackend<S, H>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
+2 -2
View File
@@ -18,12 +18,12 @@
use std::collections::HashMap;
use futures::channel::mpsc;
use primitives::storage::StorageKey;
use sp_core::storage::StorageKey;
use sp_runtime::{
traits::{Block as BlockT, NumberFor},
generic::BlockId
};
use consensus::BlockOrigin;
use sp_consensus::BlockOrigin;
use crate::blockchain::Info;
use crate::notifications::StorageEventStream;
@@ -22,7 +22,7 @@
use std::sync::{Weak, Arc};
use codec::Decode;
use primitives::{
use sp_core::{
ExecutionContext,
offchain::{self, OffchainExt, TransactionPoolExt},
traits::{BareCryptoStorePtr, KeystoreExt},
@@ -31,8 +31,8 @@ use sp_runtime::{
generic::BlockId,
traits,
};
use state_machine::{ExecutionStrategy, ExecutionManager, DefaultHandler};
use externalities::Extensions;
use sp_state_machine::{ExecutionStrategy, ExecutionManager, DefaultHandler};
use sp_externalities::Extensions;
use parking_lot::RwLock;
/// Execution strategies settings.
@@ -70,7 +70,7 @@ impl Default for ExecutionStrategies {
pub struct ExecutionExtensions<Block: traits::Block> {
strategies: ExecutionStrategies,
keystore: Option<BareCryptoStorePtr>,
transaction_pool: RwLock<Option<Weak<dyn txpool_api::OffchainSubmitTransaction<Block>>>>,
transaction_pool: RwLock<Option<Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>>>,
}
impl<Block: traits::Block> Default for ExecutionExtensions<Block> {
@@ -104,7 +104,7 @@ impl<Block: traits::Block> ExecutionExtensions<Block> {
/// extension to be a `Weak` reference.
/// That's also the reason why it's being registered lazily instead of
/// during initialisation.
pub fn register_transaction_pool(&self, pool: Weak<dyn txpool_api::OffchainSubmitTransaction<Block>>) {
pub fn register_transaction_pool(&self, pool: Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>) {
*self.transaction_pool.write() = Some(pool);
}
@@ -165,7 +165,7 @@ impl<Block: traits::Block> ExecutionExtensions<Block> {
/// A wrapper type to pass `BlockId` to the actual transaction pool.
struct TransactionPoolAdapter<Block: traits::Block> {
at: BlockId<Block>,
pool: Arc<dyn txpool_api::OffchainSubmitTransaction<Block>>,
pool: Arc<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>,
}
impl<Block: traits::Block> offchain::TransactionPool for TransactionPoolAdapter<Block> {
+2 -2
View File
@@ -32,13 +32,13 @@ pub use client::*;
pub use light::*;
pub use notifications::*;
pub use state_machine::{StorageProof, ExecutionStrategy};
pub use sp_state_machine::{StorageProof, ExecutionStrategy};
/// Utility methods for the client.
pub mod utils {
use sp_blockchain::{HeaderBackend, HeaderMetadata, Error};
use primitives::H256;
use sp_core::H256;
use sp_runtime::traits::{Block as BlockT};
use std::borrow::Borrow;
+3 -3
View File
@@ -26,8 +26,8 @@ use sp_runtime::{
},
generic::BlockId
};
use primitives::ChangesTrieConfiguration;
use state_machine::StorageProof;
use sp_core::ChangesTrieConfiguration;
use sp_state_machine::StorageProof;
use sp_blockchain::{
HeaderMetadata, well_known_cache_keys, HeaderBackend, Cache as BlockchainCache,
Error as ClientError, Result as ClientResult,
@@ -304,7 +304,7 @@ pub mod tests {
use futures::future::Ready;
use parking_lot::Mutex;
use sp_blockchain::Error as ClientError;
use test_primitives::{Block, Header, Extrinsic};
use sp_test_primitives::{Block, Header, Extrinsic};
use super::*;
pub type OkCallFetcher = Mutex<Vec<u8>>;
+1 -1
View File
@@ -23,7 +23,7 @@ use std::{
use fnv::{FnvHashSet, FnvHashMap};
use futures::channel::mpsc;
use primitives::storage::{StorageKey, StorageData};
use sp_core::storage::{StorageKey, StorageData};
use sp_runtime::traits::Block as BlockT;
/// Storage change set