[−][src]Struct sp_state_machine::StateMachine
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]
H: Hasher<Out = H256>,
Exec: CodeExecutor,
B: Backend<H>,
T: ChangesTrieStorage<H, N>,
N: BlockNumber,
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]
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
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]
&mut self,
strategy: ExecutionStrategy
) -> Result<(Vec<u8>, (B::Transaction, H::Out), Option<ChangesTrieTransaction<H, N>>), Box<dyn Error>>
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]
&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>,
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,
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,
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]
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> From<T> for 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> 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>,