pub enum VMStatus {
Executed,
Error(StatusCode),
MoveAbort(AbortLocation, u64),
ExecutionFailure {
status_code: StatusCode,
location: AbortLocation,
function: u16,
code_offset: u16,
},
}Expand description
A VMStatus is represented as either
Executedindicating successful executionErrorindicating an error from the VM itselfMoveAbortindicating anabortocurred inside of a Move program
Variants§
Executed
The VM status corresponding to an EXECUTED status code
Error(StatusCode)
Indicates an error from the VM, e.g. OUT_OF_GAS, INVALID_AUTH_KEY, RET_TYPE_MISMATCH_ERROR etc. The code will neither EXECUTED nor ABORTED
MoveAbort(AbortLocation, u64)
Indicates an abort from inside Move code. Contains the location of the abort and the code
ExecutionFailure
Indicates an failure from inside Move code, where the VM could not continue exection, e.g. dividing by zero or a missing resource
Implementations§
Source§impl VMStatus
impl VMStatus
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Return the status code for the VMStatus
Sourcepub fn move_abort_code(&self) -> Option<u64>
pub fn move_abort_code(&self) -> Option<u64>
Returns the Move abort code if the status is MoveAbort, and None otherwise
Sourcepub fn status_type(&self) -> StatusType
pub fn status_type(&self) -> StatusType
Return the status type for this VMStatus. This is solely determined by the status_code
Sourcepub fn keep_or_discard(self) -> Result<KeptVMStatus, DiscardedVMStatus>
pub fn keep_or_discard(self) -> Result<KeptVMStatus, DiscardedVMStatus>
Returns Ok with a recorded status if it should be kept, Err of the error code if it
should be discarded
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VMStatus
impl<'de> Deserialize<'de> for VMStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Error for VMStatus
impl Error for VMStatus
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()