pub struct BundleBuilder { /* private fields */ }Expand description
This builder is used to help to facilitate the initialization of BundleState struct
Implementations§
Source§impl BundleBuilder
impl BundleBuilder
Sourcepub fn new(revert_range: RangeInclusive<u64>) -> Self
pub fn new(revert_range: RangeInclusive<u64>) -> Self
Creates builder instance.
revert_range indicates the size of BundleState reverts field.
Sourcepub fn apply<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
pub fn apply<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
Applies a transformation to the builder.
Sourcepub fn apply_mut<F>(&mut self, f: F) -> &mut Selfwhere
F: FnOnce(&mut Self),
pub fn apply_mut<F>(&mut self, f: F) -> &mut Selfwhere
F: FnOnce(&mut Self),
Applies a mutable transformation to the builder.
Sourcepub fn state_address(self, address: Address) -> Self
pub fn state_address(self, address: Address) -> Self
Collects address info of BundleState state.
Sourcepub fn state_original_account_info(
self,
address: Address,
original: AccountInfo,
) -> Self
pub fn state_original_account_info( self, address: Address, original: AccountInfo, ) -> Self
Collects account info of BundleState state.
Sourcepub fn state_present_account_info(
self,
address: Address,
present: AccountInfo,
) -> Self
pub fn state_present_account_info( self, address: Address, present: AccountInfo, ) -> Self
Collects account info of BundleState state.
Sourcepub fn state_storage(
self,
address: Address,
storage: U256Map<(U256, U256)>,
) -> Self
pub fn state_storage( self, address: Address, storage: U256Map<(U256, U256)>, ) -> Self
Collects storage info of BundleState state.
Sourcepub fn revert_address(self, block_number: u64, address: Address) -> Self
pub fn revert_address(self, block_number: u64, address: Address) -> Self
Collects address info of BundleState reverts.
block_number must respect revert_range, or the input
will be ignored during the final build process.
Sourcepub fn revert_account_info(
self,
block_number: u64,
address: Address,
account: Option<Option<AccountInfo>>,
) -> Self
pub fn revert_account_info( self, block_number: u64, address: Address, account: Option<Option<AccountInfo>>, ) -> Self
Collects account info of BundleState reverts.
block_number must respect revert_range, or the input
will be ignored during the final build process.
Sourcepub fn revert_storage(
self,
block_number: u64,
address: Address,
storage: Vec<(U256, U256)>,
) -> Self
pub fn revert_storage( self, block_number: u64, address: Address, storage: Vec<(U256, U256)>, ) -> Self
Collects storage info of BundleState reverts.
block_number must respect revert_range, or the input
will be ignored during the final build process.
Sourcepub fn set_state_address(&mut self, address: Address) -> &mut Self
pub fn set_state_address(&mut self, address: Address) -> &mut Self
Sets address info of BundleState state.
Sourcepub fn set_state_original_account_info(
&mut self,
address: Address,
original: AccountInfo,
) -> &mut Self
pub fn set_state_original_account_info( &mut self, address: Address, original: AccountInfo, ) -> &mut Self
Sets original account info of BundleState state.
Sourcepub fn set_state_present_account_info(
&mut self,
address: Address,
present: AccountInfo,
) -> &mut Self
pub fn set_state_present_account_info( &mut self, address: Address, present: AccountInfo, ) -> &mut Self
Sets present account info of BundleState state.
Sourcepub fn set_state_storage(
&mut self,
address: Address,
storage: U256Map<(U256, U256)>,
) -> &mut Self
pub fn set_state_storage( &mut self, address: Address, storage: U256Map<(U256, U256)>, ) -> &mut Self
Sets storage info of BundleState state.
Sourcepub fn set_revert_address(
&mut self,
block_number: u64,
address: Address,
) -> &mut Self
pub fn set_revert_address( &mut self, block_number: u64, address: Address, ) -> &mut Self
Sets address info of BundleState reverts.
Sourcepub fn set_revert_account_info(
&mut self,
block_number: u64,
address: Address,
account: Option<Option<AccountInfo>>,
) -> &mut Self
pub fn set_revert_account_info( &mut self, block_number: u64, address: Address, account: Option<Option<AccountInfo>>, ) -> &mut Self
Sets account info of BundleState reverts.
Sourcepub fn set_revert_storage(
&mut self,
block_number: u64,
address: Address,
storage: Vec<(U256, U256)>,
) -> &mut Self
pub fn set_revert_storage( &mut self, block_number: u64, address: Address, storage: Vec<(U256, U256)>, ) -> &mut Self
Sets storage info of BundleState reverts.
Sourcepub fn set_contract(&mut self, address: B256, bytecode: Bytecode) -> &mut Self
pub fn set_contract(&mut self, address: B256, bytecode: Bytecode) -> &mut Self
Sets contracts info.
Sourcepub fn build(self) -> BundleState
pub fn build(self) -> BundleState
Creates BundleState instance based on collected information.
Sourcepub const fn get_states(&self) -> &AddressSet
pub const fn get_states(&self) -> &AddressSet
Getter for states field
Sourcepub const fn get_states_mut(&mut self) -> &mut AddressSet
pub const fn get_states_mut(&mut self) -> &mut AddressSet
Mutable getter for states field
Sourcepub const fn get_state_original_mut(&mut self) -> &mut AddressMap<AccountInfo>
pub const fn get_state_original_mut(&mut self) -> &mut AddressMap<AccountInfo>
Mutable getter for state_original field
Sourcepub const fn get_state_present_mut(&mut self) -> &mut AddressMap<AccountInfo>
pub const fn get_state_present_mut(&mut self) -> &mut AddressMap<AccountInfo>
Mutable getter for state_present field
Sourcepub const fn get_state_storage_mut(
&mut self,
) -> &mut AddressMap<U256Map<(U256, U256)>>
pub const fn get_state_storage_mut( &mut self, ) -> &mut AddressMap<U256Map<(U256, U256)>>
Mutable getter for state_storage field
Sourcepub const fn get_reverts_mut(&mut self) -> &mut BTreeSet<(u64, Address)>
pub const fn get_reverts_mut(&mut self) -> &mut BTreeSet<(u64, Address)>
Mutable getter for reverts field
Sourcepub const fn get_revert_range_mut(&mut self) -> &mut RangeInclusive<u64> ⓘ
pub const fn get_revert_range_mut(&mut self) -> &mut RangeInclusive<u64> ⓘ
Mutable getter for revert_range field
Sourcepub const fn get_revert_account_mut(
&mut self,
) -> &mut HashMap<(u64, Address), Option<Option<AccountInfo>>>
pub const fn get_revert_account_mut( &mut self, ) -> &mut HashMap<(u64, Address), Option<Option<AccountInfo>>>
Mutable getter for revert_account field
Sourcepub const fn get_revert_storage_mut(
&mut self,
) -> &mut HashMap<(u64, Address), Vec<(U256, U256)>>
pub const fn get_revert_storage_mut( &mut self, ) -> &mut HashMap<(u64, Address), Vec<(U256, U256)>>
Mutable getter for revert_storage field
Sourcepub const fn get_contracts_mut(&mut self) -> &mut B256Map<Bytecode>
pub const fn get_contracts_mut(&mut self) -> &mut B256Map<Bytecode>
Mutable getter for contracts field
Trait Implementations§
Source§impl Debug for BundleBuilder
impl Debug for BundleBuilder
Auto Trait Implementations§
impl Freeze for BundleBuilder
impl RefUnwindSafe for BundleBuilder
impl Send for BundleBuilder
impl Sync for BundleBuilder
impl Unpin for BundleBuilder
impl UnsafeUnpin for BundleBuilder
impl UnwindSafe for BundleBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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 moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
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: 328 bytes