pub struct SimBlock {
pub block_overrides: Option<BlockOverrides>,
pub state_overrides: Option<HashMap<Address, AccountOverride, FbBuildHasher<20>>>,
pub calls: Vec<TransactionRequest>,
}
Available on crate feature
eth
only.Expand description
Represents a batch of calls to be simulated sequentially within a block. This struct includes block and state overrides as well as the transaction requests to be executed.
Fields§
§block_overrides: Option<BlockOverrides>
Modifications to the default block characteristics.
state_overrides: Option<HashMap<Address, AccountOverride, FbBuildHasher<20>>>
State modifications to apply before executing the transactions.
calls: Vec<TransactionRequest>
A vector of transactions to be simulated.
Implementations§
source§impl SimBlock
impl SimBlock
sourcepub fn with_state_overrides(
self,
overrides: HashMap<Address, AccountOverride, FbBuildHasher<20>>,
) -> SimBlock
pub fn with_state_overrides( self, overrides: HashMap<Address, AccountOverride, FbBuildHasher<20>>, ) -> SimBlock
Enables state overrides
sourcepub fn with_block_overrides(self, overrides: BlockOverrides) -> SimBlock
pub fn with_block_overrides(self, overrides: BlockOverrides) -> SimBlock
Enables block overrides
sourcepub fn call(self, call: TransactionRequest) -> SimBlock
pub fn call(self, call: TransactionRequest) -> SimBlock
Adds a call to the block.
sourcepub fn extend_calls(
self,
calls: impl IntoIterator<Item = TransactionRequest>,
) -> SimBlock
pub fn extend_calls( self, calls: impl IntoIterator<Item = TransactionRequest>, ) -> SimBlock
Adds multiple calls to the block.
Trait Implementations§
source§impl<'de> Deserialize<'de> for SimBlock
impl<'de> Deserialize<'de> for SimBlock
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SimBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SimBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for SimBlock
impl Serialize for SimBlock
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for SimBlock
impl RefUnwindSafe for SimBlock
impl Send for SimBlock
impl Sync for SimBlock
impl Unpin for SimBlock
impl UnwindSafe for SimBlock
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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