dharitri_vm_executor/
breakpoint_value.rs#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BreakpointValue {
None = 0,
ExecutionFailed = 1,
AsyncCall = 2,
SignalError = 3,
OutOfGas = 4,
MemoryLimit = 5,
}
impl BreakpointValue {
pub fn as_u64(self) -> u64 {
self as u64
}
}
impl TryFrom<u64> for BreakpointValue {
type Error = String;
fn try_from(value: u64) -> Result<Self, Self::Error> {
match value {
0 => Ok(BreakpointValue::None),
1 => Ok(BreakpointValue::ExecutionFailed),
2 => Ok(BreakpointValue::AsyncCall),
3 => Ok(BreakpointValue::SignalError),
4 => Ok(BreakpointValue::OutOfGas),
5 => Ok(BreakpointValue::MemoryLimit),
_ => Err("unknown breakpoint".to_string()),
}
}
}