Struct precompile_utils::testing::execution::PrecompilesTester
source · pub struct PrecompilesTester<'p, P> { /* private fields */ }
Implementations§
source§impl<'p, P: PrecompileSet> PrecompilesTester<'p, P>
impl<'p, P: PrecompileSet> PrecompilesTester<'p, P>
pub fn new( precompiles: &'p P, from: impl Into<H160>, to: impl Into<H160>, data: Vec<u8> ) -> Self
pub fn with_value(self, value: impl Into<U256>) -> Self
pub fn with_subcall_handle(self, subcall_handle: impl SubcallTrait) -> Self
pub fn with_target_gas(self, target_gas: Option<u64>) -> Self
pub fn with_static_call(self, static_call: bool) -> Self
pub fn expect_cost(self, cost: u64) -> Self
pub fn expect_no_logs(self) -> Self
pub fn expect_log(self, log: Log) -> Self
sourcepub fn execute_some(self)
pub fn execute_some(self)
Execute the precompile set and expect some precompile to have been executed, regardless of the result.
sourcepub fn execute_none(self)
pub fn execute_none(self)
Execute the precompile set and expect no precompile to have been executed.
sourcepub fn execute_returns_raw(self, output: Vec<u8>)
pub fn execute_returns_raw(self, output: Vec<u8>)
Execute the precompile set and check it returns provided output.
sourcepub fn execute_returns(self, output: impl Codec)
pub fn execute_returns(self, output: impl Codec)
Execute the precompile set and check it returns provided Solidity encoded output.
sourcepub fn execute_reverts(self, check: impl Fn(&[u8]) -> bool)
pub fn execute_reverts(self, check: impl Fn(&[u8]) -> bool)
Execute the precompile set and check if it reverts. Take a closure allowing to perform custom matching on the output.
sourcepub fn execute_error(self, error: ExitError)
pub fn execute_error(self, error: ExitError)
Execute the precompile set and check it returns provided output.
Auto Trait Implementations§
impl<'p, P> !RefUnwindSafe for PrecompilesTester<'p, P>
impl<'p, P> !Send for PrecompilesTester<'p, P>
impl<'p, P> !Sync for PrecompilesTester<'p, P>
impl<'p, P> Unpin for PrecompilesTester<'p, P>
impl<'p, P> !UnwindSafe for PrecompilesTester<'p, P>
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
Mutably borrows from an owned value. Read more
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
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>
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.