pub struct TestExternalities<H: Hasher, N: ChangesTrieBlockNumber = u64> where
    H::Out: Codec + Ord
{ /* private fields */ }
Expand description

Simple HashMap-based Externalities impl.

Implementations

Get externalities implementation.

Create a new instance of TestExternalities with storage.

New empty test externalities.

Create a new instance of TestExternalities with code and storage.

Returns the overlayed changes.

Move offchain changes from overlay to the persistent store.

A shared reference type around the offchain worker storage.

Insert key/value into backend

Registers the given extension for this instance.

Get mutable reference to changes trie storage.

Commit all pending changes to the underlying backend.

Panic

This will panic if there are still open transactions.

Execute the given closure while self is set as externalities.

Returns the result of the given closure.

Execute the given closure while self is set as externalities.

Returns the result of the given closure, if no panics occured. Otherwise, returns Err.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Tries to find a registered extension by the given type_id and returns it as a &mut dyn Any. Read more

Register extension extension with specified type_id. Read more

Deregister extension with speicifed ‘type_id’ and drop it. Read more

Performs the conversion.

This doesn’t test if they are in the same state, only if they contains the same data at this state

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.