multiversx_chain_vm_executor/
breakpoint_value.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8pub enum BreakpointValueLegacy {
9 None = 0,
11
12 ExecutionFailed = 1,
14
15 AsyncCall = 2,
17
18 SignalError = 3,
20
21 OutOfGas = 4,
23
24 MemoryLimit = 5,
26}
27
28impl BreakpointValueLegacy {
29 pub fn as_u64(self) -> u64 {
30 self as u64
31 }
32}
33
34impl TryFrom<u64> for BreakpointValueLegacy {
35 type Error = String;
36
37 fn try_from(value: u64) -> Result<Self, Self::Error> {
38 match value {
39 0 => Ok(BreakpointValueLegacy::None),
40 1 => Ok(BreakpointValueLegacy::ExecutionFailed),
41 2 => Ok(BreakpointValueLegacy::AsyncCall),
42 3 => Ok(BreakpointValueLegacy::SignalError),
43 4 => Ok(BreakpointValueLegacy::OutOfGas),
44 5 => Ok(BreakpointValueLegacy::MemoryLimit),
45 _ => Err("unknown breakpoint".to_string()),
46 }
47 }
48}