pub enum ExecutorConfig {
Debugger,
Custom(fn(RuntimeWeakRef) -> Box<dyn Executor + Send + Sync>),
Experimental,
CompiledFeatureIfElse {
if_compiled: Box<ExecutorConfig>,
fallback: Box<ExecutorConfig>,
},
Composite(Vec<ExecutorConfig>),
}
Variants§
Debugger
Uses the debugger infrastructure: testing the smart contract code directly.
Custom(fn(RuntimeWeakRef) -> Box<dyn Executor + Send + Sync>)
Use to add a custom executor builder function in the contract crate (via dependency inversion).
Created specifically to avoid referencing the Wasmer 2.2 crate from the VM.
Experimental
Use the compiled contract in the experimental Wasmer 6 executor.
CompiledFeatureIfElse
If feature compiled-sc-tests
is active, use the given config. Otherwise use fallback config.
Composite(Vec<ExecutorConfig>)
Defines a list of executors, to be used in order. If one of them refuses to execute, the next one is used as fallback.
Implementations§
Source§impl ExecutorConfig
impl ExecutorConfig
Sourcepub fn then(self, next: ExecutorConfig) -> ExecutorConfig
pub fn then(self, next: ExecutorConfig) -> ExecutorConfig
Try using the current config, if it cannot be used, attempt the same with the next one.
Sourcepub fn compiled_tests_if_else(
if_compiled: ExecutorConfig,
fallback: ExecutorConfig,
) -> ExecutorConfig
pub fn compiled_tests_if_else( if_compiled: ExecutorConfig, fallback: ExecutorConfig, ) -> ExecutorConfig
Use the compiled contract only if feature compiled-sc-tests
is active. Otherwise use fallback config.
Sourcepub fn compiled_tests_or(fallback: ExecutorConfig) -> ExecutorConfig
pub fn compiled_tests_or(fallback: ExecutorConfig) -> ExecutorConfig
Run the compiled contract with the experimental executor if feature compiled-sc-tests
is active. Otherwise use fallback config.
Sourcepub fn full_suite() -> ExecutorConfig
pub fn full_suite() -> ExecutorConfig
Tests with:
- compiled tests (if feature
compiled-sc-tests
is active), - otherwise:
- first try the debugger,
- then finally the experimental Wasmer.
This means contracts will be tested natively in the wasm tests.
Trait Implementations§
Source§impl Clone for ExecutorConfig
impl Clone for ExecutorConfig
Source§fn clone(&self) -> ExecutorConfig
fn clone(&self) -> ExecutorConfig
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ExecutorConfig
impl Debug for ExecutorConfig
Source§impl Default for ExecutorConfig
impl Default for ExecutorConfig
Source§fn default() -> ExecutorConfig
fn default() -> ExecutorConfig
Source§impl PartialEq for ExecutorConfig
impl PartialEq for ExecutorConfig
impl Eq for ExecutorConfig
impl StructuralPartialEq for ExecutorConfig
Auto Trait Implementations§
impl Freeze for ExecutorConfig
impl RefUnwindSafe for ExecutorConfig
impl Send for ExecutorConfig
impl Sync for ExecutorConfig
impl Unpin for ExecutorConfig
impl UnwindSafe for ExecutorConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
fn interpret_from(from: &T, _context: &InterpreterContext) -> T
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more