pub struct ExecutorState<'a> {Show 17 fields
pub params: &'a ExecutorParams,
pub config: &'a ParsedConfig,
pub is_special: bool,
pub is_marks_authority: bool,
pub is_suspended_by_marks: bool,
pub address: StdAddr,
pub storage_stat: StorageInfo,
pub balance: CurrencyCollection,
pub state: AccountState,
pub orig_status: AccountStatus,
pub end_status: AccountStatus,
pub start_lt: u64,
pub end_lt: u64,
pub out_msgs: Vec<Lazy<OwnedMessage>>,
pub total_fees: Tokens,
pub burned: Tokens,
pub cached_storage_stat: Option<OwnedExtStorageStat>,
}Expand description
Shared state for executor phases.
Fields§
§params: &'a ExecutorParams§config: &'a ParsedConfig§is_special: bool§is_suspended_by_marks: bool§address: StdAddr§storage_stat: StorageInfo§balance: CurrencyCollection§state: AccountState§orig_status: AccountStatus§end_status: AccountStatus§start_lt: u64§end_lt: u64§out_msgs: Vec<Lazy<OwnedMessage>>§total_fees: Tokens§burned: Tokens§cached_storage_stat: Option<OwnedExtStorageStat>Implementations§
Source§impl ExecutorState<'_>
impl ExecutorState<'_>
pub fn action_phase( &mut self, ctx: ActionPhaseContext<'_, '_>, ) -> Result<ActionPhaseFull>
Source§impl ExecutorState<'_>
impl ExecutorState<'_>
Sourcepub fn bounce_phase(
&mut self,
ctx: BouncePhaseContext<'_>,
) -> Result<BouncePhase>
pub fn bounce_phase( &mut self, ctx: BouncePhaseContext<'_>, ) -> Result<BouncePhase>
Bounce phase of ordinary transactions.
- Tries to send an inbound message back to the sender;
- Defined only for internal inbound messages;
- Remaining message balance is substracted from the account balance;
- Fees are paid using the remaining inbound message balance;
Returns an executed BouncePhase.
Fails if the origin workchain of the message doesn’t exist or
disabled. Can also fail on total_fees overflow, but this should
not happen on networks with valid value flow.
Source§impl ExecutorState<'_>
impl ExecutorState<'_>
Sourcepub fn compute_phase(
&mut self,
ctx: ComputePhaseContext<'_, '_>,
) -> Result<ComputePhaseFull>
pub fn compute_phase( &mut self, ctx: ComputePhaseContext<'_, '_>, ) -> Result<ComputePhaseFull>
Compute phase of ordinary or ticktock transactions.
- Tries to deploy or unfreeze account if it was
UninitorFrozen; - Executes contract code and produces a new account state;
- Produces an action list on successful execution;
- External messages can be ignored if they were not accepted;
- Necessary for all types of messages or even without them;
Returns an executed ComputePhase with extra data.
Fails only on account balance overflow. This should not happen on networks with valid value flow.
Source§impl ExecutorState<'_>
impl ExecutorState<'_>
Sourcepub fn credit_phase(
&mut self,
received: &ReceivedMessage,
) -> Result<CreditPhase>
pub fn credit_phase( &mut self, received: &ReceivedMessage, ) -> Result<CreditPhase>
Credit phase of ordinary transactions.
- Adds the remainder of the message balance to the account balance;
- Requires calling the
receive_in_msgfirst; - Only makes sense for internal messages;
- Follows the storage phase when
bounce_enabled, otherwise must be called before it.
Returns an executed CreditPhase.
Fails only on account balance overflow. This should not happen on networks with valid value flow.
Source§impl ExecutorState<'_>
impl ExecutorState<'_>
Sourcepub fn receive_in_msg(&mut self, msg_root: Cell) -> Result<ReceivedMessage>
pub fn receive_in_msg(&mut self, msg_root: Cell) -> Result<ReceivedMessage>
“Pre” phase of ordinary transactions.
- Validates the inbound message cell;
- For internal messages updates an LT range;
- For external messages charges a fwd fee
(updates
self.balanceandself.total_fees).
Returns a parsed received message (ReceivedMessage).
Fails if the message is invalid or can’t be imported.
Source§impl ExecutorState<'_>
impl ExecutorState<'_>
Sourcepub fn storage_phase(
&mut self,
ctx: StoragePhaseContext<'_>,
) -> Result<StoragePhase>
pub fn storage_phase( &mut self, ctx: StoragePhaseContext<'_>, ) -> Result<StoragePhase>
Storage phase of ordinary or ticktock transactions.
- Precedes the credit phase when
bounce_enabled, otherwise must be called after it; - Necessary for all types of messages or even without them;
- Computes storage fee and due payment;
- Tries to charge the account balance for the storage fees;
- Freezes or deletes the account if its balance is not enough (doesn’t change the state itself, but rather tells other phases to do so).
Returns an executed StoragePhase.
Fails if called in an older context than account’s last_paid.
Can also fail on total_fees overflow, but this should
not happen on networks with valid value flow.