pub struct StackSubstateMetadata<'config> { /* private fields */ }Implementations§
Source§impl<'config> StackSubstateMetadata<'config>
impl<'config> StackSubstateMetadata<'config>
pub fn new(gas_limit: u64, config: &'config Config) -> Self
Sourcepub fn swallow_commit(&mut self, other: Self) -> Result<(), ExitError>
pub fn swallow_commit(&mut self, other: Self) -> Result<(), ExitError>
Swallow commit implements part of logic for exit_commit:
- Record opcode stipend.
- Record an explicit refund.
- Merge warmed accounts and storages
§Errors
Return ExitError that is thrown by gasometer gas calculation errors.
Sourcepub fn swallow_revert(&mut self, other: &Self) -> Result<(), ExitError>
pub fn swallow_revert(&mut self, other: &Self) -> Result<(), ExitError>
Swallow revert implements part of logic for exit_commit:
- Record opcode stipend.
§Errors
Return ExitError that is thrown by gasometer gas calculation errors.
Sourcepub const fn swallow_discard(&self, _other: &Self)
pub const fn swallow_discard(&self, _other: &Self)
Swallow revert implements part of logic for exit_commit:
At the moment, it does nothing.
pub fn spit_child(&self, gas_limit: u64, is_static: bool) -> Self
pub const fn gasometer(&self) -> &Gasometer<'config>
pub const fn gasometer_mut(&mut self) -> &mut Gasometer<'config>
pub const fn is_static(&self) -> bool
pub const fn depth(&self) -> Option<usize>
pub fn access_address(&mut self, address: H160)
pub fn access_addresses<I>(&mut self, addresses: I)
pub fn access_storage(&mut self, address: H160, key: H256)
pub fn access_storages<I>(&mut self, storages: I)
Sourcepub const fn accessed(&self) -> &Option<Accessed>
pub const fn accessed(&self) -> &Option<Accessed>
Used for gas calculation logic.
It’s most significant for cold/warm gas calculation as warmed addresses spent less gas.
Add authority to accessed list (related to EIP-7702)
Remove authority from accessed list (related to EIP-7702)
Trait Implementations§
Source§impl<'config> Clone for StackSubstateMetadata<'config>
impl<'config> Clone for StackSubstateMetadata<'config>
Source§fn clone(&self) -> StackSubstateMetadata<'config>
fn clone(&self) -> StackSubstateMetadata<'config>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'config> Freeze for StackSubstateMetadata<'config>
impl<'config> RefUnwindSafe for StackSubstateMetadata<'config>
impl<'config> Send for StackSubstateMetadata<'config>
impl<'config> Sync for StackSubstateMetadata<'config>
impl<'config> Unpin for StackSubstateMetadata<'config>
impl<'config> UnwindSafe for StackSubstateMetadata<'config>
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