[][src]Struct sp_state_machine::StateMachine

pub struct StateMachine<'a, B, H, N, T, Exec> where
    H: Hasher<Out = H256>,
    B: Backend<H>, 
{ /* fields omitted */ }

The substrate state machine.

Methods

impl<'a, B, H, N, T, Exec> StateMachine<'a, B, H, N, T, Exec> where
    H: Hasher<Out = H256>,
    Exec: CodeExecutor,
    B: Backend<H>,
    T: ChangesTrieStorage<H, N>,
    N: BlockNumber, 
[src]

pub fn new(
    backend: &'a B,
    changes_trie_storage: Option<&'a T>,
    overlay: &'a mut OverlayedChanges,
    exec: &'a Exec,
    method: &'a str,
    call_data: &'a [u8],
    extensions: Extensions
) -> Self
[src]

Creates new substrate state machine.

pub fn execute(
    &mut self,
    strategy: ExecutionStrategy
) -> Result<(Vec<u8>, (B::Transaction, H::Out), Option<ChangesTrieTransaction<H, N>>), Box<dyn Error>>
[src]

Execute a call using the given state backend, overlayed changes, and call executor. Produces a state-backend-specific "transaction" which can be used to apply the changes to the backing store, such as the disk.

On an error, no prospective changes are written to the overlay.

Note: changes to code will be in place if this call is made again. For running partial blocks (e.g. a transaction at a time), ensure a different method is used.

pub fn execute_using_consensus_failure_handler<Handler, R, NC>(
    &mut self,
    manager: ExecutionManager<Handler>,
    compute_tx: bool,
    native_call: Option<NC>
) -> Result<(NativeOrEncoded<R>, Option<(B::Transaction, H::Out)>, Option<ChangesTrieTransaction<H, N>>), Box<dyn Error>> where
    R: Decode + Encode + PartialEq,
    NC: FnOnce() -> Result<R, String> + UnwindSafe,
    Handler: FnOnce(Result<NativeOrEncoded<R>, Exec::Error>, Result<NativeOrEncoded<R>, Exec::Error>) -> Result<NativeOrEncoded<R>, Exec::Error>, 
[src]

Execute a call using the given state backend, overlayed changes, and call executor. Produces a state-backend-specific "transaction" which can be used to apply the changes to the backing store, such as the disk.

On an error, no prospective changes are written to the overlay.

Note: changes to code will be in place if this call is made again. For running partial blocks (e.g. a transaction at a time), ensure a different method is used.

Auto Trait Implementations

impl<'a, B, H, N, T, Exec> !RefUnwindSafe for StateMachine<'a, B, H, N, T, Exec>

impl<'a, B, H, N, T, Exec> Send for StateMachine<'a, B, H, N, T, Exec> where
    B: Sync,
    Exec: Sync,
    N: Send,
    T: Sync

impl<'a, B, H, N, T, Exec> !Sync for StateMachine<'a, B, H, N, T, Exec>

impl<'a, B, H, N, T, Exec> Unpin for StateMachine<'a, B, H, N, T, Exec> where
    H: Unpin,
    N: Unpin

impl<'a, B, H, N, T, Exec> !UnwindSafe for StateMachine<'a, B, H, N, T, Exec>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

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> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]