[−][src]Struct sp_state_machine::TestExternalities
Simple HashMap-based Externalities impl.
Implementations
impl<H: Hasher, N: ChangesTrieBlockNumber> TestExternalities<H, N> where
H::Out: Ord + 'static + Codec,
[src]
H::Out: Ord + 'static + Codec,
pub fn ext(&mut self) -> Ext<'_, H, N, InMemoryBackend<H>>
[src]
Get externalities implementation.
pub fn new(storage: Storage) -> Self
[src]
Create a new instance of TestExternalities
with storage.
pub fn new_empty() -> Self
[src]
New empty test externalities.
pub fn new_with_code(code: &[u8], storage: Storage) -> Self
[src]
Create a new instance of TestExternalities
with code and storage.
pub fn persist_offchain_overlay(&mut self)
[src]
Move offchain changes from overlay to the persistent store.
pub fn offchain_db(&self) -> TestPersistentOffchainDB
[src]
A shared reference type around the offchain worker storage.
pub fn insert(&mut self, k: StorageKey, v: StorageValue)
[src]
Insert key/value into backend
pub fn register_extension<E: Any + Extension>(&mut self, ext: E)
[src]
Registers the given extension for this instance.
pub fn changes_trie_storage(&mut self) -> &mut ChangesTrieInMemoryStorage<H, N>
[src]
Get mutable reference to changes trie storage.
pub fn commit_all(&self) -> InMemoryBackend<H>
[src]
Return a new backend with all pending value.
pub fn execute_with<R>(&mut self, execute: impl FnOnce() -> R) -> R
[src]
Execute the given closure while self
is set as externalities.
Returns the result of the given closure.
Trait Implementations
impl<H: Hasher, N: ChangesTrieBlockNumber> Debug for TestExternalities<H, N> where
H::Out: Ord + Codec,
[src]
H::Out: Ord + Codec,
impl<H: Hasher, N: ChangesTrieBlockNumber> Default for TestExternalities<H, N> where
H::Out: Ord + 'static + Codec,
[src]
H::Out: Ord + 'static + Codec,
impl<H, N> ExtensionStore for TestExternalities<H, N> where
H: Hasher,
H::Out: Ord + Codec,
N: ChangesTrieBlockNumber,
[src]
H: Hasher,
H::Out: Ord + Codec,
N: ChangesTrieBlockNumber,
fn extension_by_type_id(&mut self, type_id: TypeId) -> Option<&mut dyn Any>
[src]
fn register_extension_with_type_id(
&mut self,
type_id: TypeId,
extension: Box<dyn Extension>
) -> Result<(), Error>
[src]
&mut self,
type_id: TypeId,
extension: Box<dyn Extension>
) -> Result<(), Error>
fn deregister_extension_by_type_id(
&mut self,
type_id: TypeId
) -> Result<(), Error>
[src]
&mut self,
type_id: TypeId
) -> Result<(), Error>
impl<H: Hasher, N: ChangesTrieBlockNumber> From<Storage> for TestExternalities<H, N> where
H::Out: Ord + 'static + Codec,
[src]
H::Out: Ord + 'static + Codec,
impl<H: Hasher, N: ChangesTrieBlockNumber> PartialEq<TestExternalities<H, N>> for TestExternalities<H, N> where
H::Out: Ord + 'static + Codec,
[src]
H::Out: Ord + 'static + Codec,
Auto Trait Implementations
impl<H, N = u64> !RefUnwindSafe for TestExternalities<H, N>
impl<H, N> Send for TestExternalities<H, N> where
<H as Hasher>::Out: Send,
<H as Hasher>::Out: Send,
impl<H, N = u64> !Sync for TestExternalities<H, N>
impl<H, N> Unpin for TestExternalities<H, N> where
H: Unpin,
N: Unpin,
<H as Hasher>::Out: Unpin,
H: Unpin,
N: Unpin,
<H as Hasher>::Out: Unpin,
impl<H, N = u64> !UnwindSafe for TestExternalities<H, N>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
[src]
T: InitializableFromZeroed + ?Sized,
impl<T> From<T> for T
[src]
impl<T> InitializableFromZeroed for T where
T: Default,
[src]
T: Default,
unsafe fn initialize(place: *mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
[src]
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
fn from_ref(outer: &Outer) -> &T
[src]
Get a reference to the inner from the outer.
fn from_mut(outer: &mut Outer) -> &mut T
[src]
Get a mutable reference to the inner from the outer.
impl<T> MaybeDebug for T where
T: Debug,
[src]
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
[src]
T: Debug,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,