mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +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
@@ -40,13 +40,13 @@ use threadpool::ThreadPool;
|
||||
use sp_api::ApiExt;
|
||||
use futures::future::Future;
|
||||
use log::{debug, warn};
|
||||
use network::NetworkStateInfo;
|
||||
use primitives::{offchain::{self, OffchainStorage}, ExecutionContext};
|
||||
use sc_network::NetworkStateInfo;
|
||||
use sp_core::{offchain::{self, OffchainStorage}, ExecutionContext};
|
||||
use sp_runtime::{generic::BlockId, traits::{self, ProvideRuntimeApi}};
|
||||
|
||||
mod api;
|
||||
|
||||
pub use offchain_primitives::{OffchainWorkerApi, STORAGE_PREFIX};
|
||||
pub use sp_offchain::{OffchainWorkerApi, STORAGE_PREFIX};
|
||||
|
||||
/// An offchain workers manager.
|
||||
pub struct OffchainWorkers<Client, Storage, Block: traits::Block> {
|
||||
@@ -146,10 +146,10 @@ impl<Client, Storage, Block> OffchainWorkers<
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::sync::Arc;
|
||||
use network::{Multiaddr, PeerId};
|
||||
use test_client::runtime::Block;
|
||||
use txpool::{BasicPool, FullChainApi};
|
||||
use txpool_api::{TransactionPool, InPoolTransaction};
|
||||
use sc_network::{Multiaddr, PeerId};
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
use sc_transaction_pool::{BasicPool, FullChainApi};
|
||||
use sp_transaction_pool::{TransactionPool, InPoolTransaction};
|
||||
|
||||
struct MockNetworkStateInfo();
|
||||
|
||||
@@ -163,9 +163,9 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
struct TestPool(BasicPool<FullChainApi<test_client::TestClient, Block>, Block>);
|
||||
struct TestPool(BasicPool<FullChainApi<substrate_test_runtime_client::TestClient, Block>, Block>);
|
||||
|
||||
impl txpool_api::OffchainSubmitTransaction<Block> for TestPool {
|
||||
impl sp_transaction_pool::OffchainSubmitTransaction<Block> for TestPool {
|
||||
fn submit_at(
|
||||
&self,
|
||||
at: &BlockId<Block>,
|
||||
@@ -181,11 +181,11 @@ mod tests {
|
||||
fn should_call_into_runtime_and_produce_extrinsic() {
|
||||
// given
|
||||
let _ = env_logger::try_init();
|
||||
let client = Arc::new(test_client::new());
|
||||
let client = Arc::new(substrate_test_runtime_client::new());
|
||||
let pool = Arc::new(TestPool(BasicPool::new(Default::default(), FullChainApi::new(client.clone()))));
|
||||
client.execution_extensions()
|
||||
.register_transaction_pool(Arc::downgrade(&pool.clone()) as _);
|
||||
let db = client_db::offchain::LocalStorage::new_test();
|
||||
let db = sc_client_db::offchain::LocalStorage::new_test();
|
||||
let network_state = Arc::new(MockNetworkStateInfo());
|
||||
|
||||
// when
|
||||
|
||||
Reference in New Issue
Block a user