pub struct mockFunctionCall {
pub callee: Address,
pub target: Address,
pub data: Bytes,
}
Expand description
Whenever a call is made to callee
with calldata data
, this cheatcode instead calls
target
with the same calldata. This functionality is similar to a delegate call made to
target
contract from callee
.
Can be used to substitute a call to a function with another implementation that captures
the primary logic of the original function but is easier to reason about.
If calldata is not a strict match then partial match by selector is attempted.
Function with signature mockFunction(address,address,bytes)
and selector 0xadf84d21
.
function mockFunction(address callee, address target, bytes calldata data) external;
Fields§
§callee: Address
§target: Address
§data: Bytes
Trait Implementations§
Source§impl CheatcodeDef for mockFunctionCall
impl CheatcodeDef for mockFunctionCall
Source§impl Clone for mockFunctionCall
impl Clone for mockFunctionCall
Source§fn clone(&self) -> mockFunctionCall
fn clone(&self) -> mockFunctionCall
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for mockFunctionCall
impl Debug for mockFunctionCall
Source§impl SolCall for mockFunctionCall
impl SolCall for mockFunctionCall
Source§const SIGNATURE: &'static str = "mockFunction(address,address,bytes)"
const SIGNATURE: &'static str = "mockFunction(address,address,bytes)"
Source§type Parameters<'a> = (Address, Address, Bytes)
type Parameters<'a> = (Address, Address, Bytes)
Source§type Token<'a> = <<mockFunctionCall as SolCall>::Parameters<'a> as SolType>::Token<'a>
type Token<'a> = <<mockFunctionCall as SolCall>::Parameters<'a> as SolType>::Token<'a>
Source§type Return = mockFunctionReturn
type Return = mockFunctionReturn
Source§type ReturnTuple<'a> = ()
type ReturnTuple<'a> = ()
Source§type ReturnToken<'a> = <<mockFunctionCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>
type ReturnToken<'a> = <<mockFunctionCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>
Source§fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self
fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self
Source§fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>
fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>
§fn abi_encoded_size(&self) -> usize
fn abi_encoded_size(&self) -> usize
§fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>
fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>
§fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>
fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>
§fn abi_encode_raw(&self, out: &mut Vec<u8>)
fn abi_encode_raw(&self, out: &mut Vec<u8>)
§fn abi_encode(&self) -> Vec<u8>
fn abi_encode(&self) -> Vec<u8>
§fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8>where
E: SolTypeValue<Self::ReturnTuple<'a>>,
fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8>where
E: SolTypeValue<Self::ReturnTuple<'a>>,
Auto Trait Implementations§
impl !Freeze for mockFunctionCall
impl RefUnwindSafe for mockFunctionCall
impl Send for mockFunctionCall
impl Sync for mockFunctionCall
impl Unpin for mockFunctionCall
impl UnwindSafe for mockFunctionCall
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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes