pub struct mockCall_4Call {
pub callee: Address,
pub data: Bytes,
pub returnData: Bytes,
pub injectCode: bool,
}Expand description
Mocks a call to an address, returning specified data. Calldata can either be strict or a partial match, e.g. if you only pass a Solidity selector to the expected calldata, then the entire Solidity function will be mocked.
Overload to control whether code is injected into callee. The other overloads etch a
single byte into an empty account to circumvent Solidity’s extcodesize check, with the
side effect that unmocked calls to it no longer revert; injectCode = false leaves the
account codeless, so unmocked calls to it revert in the caller. Mocked calls that return
data still succeed, as Solidity checks returndatasize() instead of extcodesize() when
return data is expected, but mocked calls to functions without return values may still
revert in the caller due to the extcodesize check.
Function with signature mockCall(address,bytes,bytes,bool) and selector 0xb4bc5617.
function mockCall(address callee, bytes calldata data, bytes calldata returnData, bool injectCode) external;Fields§
§callee: Address§data: Bytes§returnData: Bytes§injectCode: boolTrait Implementations§
Source§impl CheatcodeDef for mockCall_4Call
impl CheatcodeDef for mockCall_4Call
Source§impl Clone for mockCall_4Call
impl Clone for mockCall_4Call
Source§fn clone(&self) -> mockCall_4Call
fn clone(&self) -> mockCall_4Call
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for mockCall_4Call
impl Debug for mockCall_4Call
Source§impl JsonAbiExt for mockCall_4Call
impl JsonAbiExt for mockCall_4Call
Source§impl SolCall for mockCall_4Call
impl SolCall for mockCall_4Call
Source§const SIGNATURE: &'static str = "mockCall(address,bytes,bytes,bool)"
const SIGNATURE: &'static str = "mockCall(address,bytes,bytes,bool)"
Source§type Parameters<'a> = (Address, Bytes, Bytes, Bool)
type Parameters<'a> = (Address, Bytes, Bytes, Bool)
Source§type Token<'a> = <<mockCall_4Call as SolCall>::Parameters<'a> as SolType>::Token<'a>
type Token<'a> = <<mockCall_4Call as SolCall>::Parameters<'a> as SolType>::Token<'a>
Source§type Return = mockCall_4Return
type Return = mockCall_4Return
Source§type ReturnTuple<'a> = ()
type ReturnTuple<'a> = ()
Source§type ReturnToken<'a> = <<mockCall_4Call as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>
type ReturnToken<'a> = <<mockCall_4Call 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 tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_>
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_>
Source§fn abi_decode_returns(data: &[u8]) -> Result<Self::Return>
fn abi_decode_returns(data: &[u8]) -> Result<Self::Return>
Source§fn abi_decode_returns_validate(data: &[u8]) -> Result<Self::Return>
fn abi_decode_returns_validate(data: &[u8]) -> Result<Self::Return>
§fn abi_encoded_size(&self) -> usize
fn abi_encoded_size(&self) -> usize
§fn abi_decode_raw(data: &[u8]) -> Result<Self, Error>
fn abi_decode_raw(data: &[u8]) -> Result<Self, Error>
§fn abi_decode_raw_validate(data: &[u8]) -> Result<Self, Error>
fn abi_decode_raw_validate(data: &[u8]) -> Result<Self, Error>
§fn abi_decode(data: &[u8]) -> Result<Self, Error>
fn abi_decode(data: &[u8]) -> Result<Self, Error>
§fn abi_decode_validate(data: &[u8]) -> Result<Self, Error>
fn abi_decode_validate(data: &[u8]) -> 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(ret: &Self::Return) -> Vec<u8> ⓘ
fn abi_encode_returns(ret: &Self::Return) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl !Freeze for mockCall_4Call
impl RefUnwindSafe for mockCall_4Call
impl Send for mockCall_4Call
impl Sync for mockCall_4Call
impl Unpin for mockCall_4Call
impl UnsafeUnpin for mockCall_4Call
impl UnwindSafe for mockCall_4Call
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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: 88 bytes