mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 01:07:57 +00:00
Name all the tasks! (#6726)
* Remove any implementation of `Spawn` or `Executor` from our task executors * Fix compilation * Rename `SpawnBlockingExecutor` * Update primitives/core/src/traits.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Fix tests Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -33,7 +33,7 @@ use sp_core::{
|
||||
};
|
||||
use log::warn;
|
||||
use codec::Encode;
|
||||
use sp_externalities::Extensions;
|
||||
use sp_externalities::{Extensions, Extension};
|
||||
|
||||
/// Simple Map-based Externalities impl.
|
||||
#[derive(Debug)]
|
||||
@@ -53,17 +53,6 @@ impl BasicExternalities {
|
||||
Self::new(Storage::default())
|
||||
}
|
||||
|
||||
/// New basic extternalities with tasks executor.
|
||||
pub fn with_tasks_executor() -> Self {
|
||||
let mut extensions = Extensions::default();
|
||||
extensions.register(sp_core::traits::TaskExecutorExt(sp_core::tasks::executor()));
|
||||
|
||||
Self {
|
||||
inner: Storage::default(),
|
||||
extensions,
|
||||
}
|
||||
}
|
||||
|
||||
/// Insert key/value
|
||||
pub fn insert(&mut self, k: StorageKey, v: StorageValue) -> Option<StorageValue> {
|
||||
self.inner.top.insert(k, v)
|
||||
@@ -107,6 +96,11 @@ impl BasicExternalities {
|
||||
pub fn extensions(&mut self) -> &mut Extensions {
|
||||
&mut self.extensions
|
||||
}
|
||||
|
||||
/// Register an extension.
|
||||
pub fn register_extension(&mut self, ext: impl Extension) {
|
||||
self.extensions.register(ext);
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for BasicExternalities {
|
||||
|
||||
Reference in New Issue
Block a user