pub enum TransactionResult {
Pending {
status: TxExecutionStatus,
},
Full(Box<ExecutionFinalResult>),
}Expand description
The result of sending a transaction to the network.
Depending on the TxExecutionStatus used with wait_until, the RPC may return
either a full execution result or just a confirmation that the transaction was received.
wait_until(TxExecutionStatus::None)orwait_until(TxExecutionStatus::Included)will returnTransactionResult::Pendingsince the transaction hasn’t been executed yet.- Higher finality levels (
ExecutedOptimistic,Final, etc.) will returnTransactionResult::Fullwith the full execution outcome.
Variants§
Pending
Transaction was submitted but execution results are not yet available.
This is returned when wait_until is set to None or Included.
The status field indicates how far the transaction has progressed.
Fields
status: TxExecutionStatusFull(Box<ExecutionFinalResult>)
Full execution result is available.
Implementations§
Source§impl TransactionResult
impl TransactionResult
Sourcepub fn into_result(self) -> Result<ExecutionSuccess, TransactionResultError>
pub fn into_result(self) -> Result<ExecutionSuccess, TransactionResultError>
Returns the full execution result if available, or an error if the transaction is still pending.
Sourcepub fn assert_success(self) -> ExecutionSuccess
pub fn assert_success(self) -> ExecutionSuccess
Unwraps the full execution result, panicking if the transaction is pending or failed.
Sourcepub const fn is_full(&self) -> bool
pub const fn is_full(&self) -> bool
Returns true if the transaction has a full execution result.
Sourcepub const fn is_pending(&self) -> bool
pub const fn is_pending(&self) -> bool
Returns true if the transaction is still pending.
Sourcepub fn into_full(self) -> Option<ExecutionFinalResult>
pub fn into_full(self) -> Option<ExecutionFinalResult>
Returns the full execution result, if available.
Sourcepub fn pending_status(self) -> Option<TxExecutionStatus>
pub fn pending_status(self) -> Option<TxExecutionStatus>
Returns the pending status, if the transaction is still pending.
Sourcepub fn assert_failure(self) -> ExecutionResult<TxExecutionError>
pub fn assert_failure(self) -> ExecutionResult<TxExecutionError>
Unwraps the execution failure, panicking if the transaction is pending or succeeded.
Sourcepub const fn is_failure(&self) -> bool
pub const fn is_failure(&self) -> bool
Checks whether the transaction has failed. Returns false if the transaction
is still pending or succeeded.
Sourcepub const fn is_success(&self) -> bool
pub const fn is_success(&self) -> bool
Checks whether the transaction was successful. Returns false if the transaction
is still pending or failed.
Sourcepub fn transaction(&self) -> &Transaction
pub fn transaction(&self) -> &Transaction
Trait Implementations§
Source§impl Clone for TransactionResult
impl Clone for TransactionResult
Source§fn clone(&self) -> TransactionResult
fn clone(&self) -> TransactionResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more