1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#[cfg(not(target_arch = "wasm32"))]
pub use near_vm_logic::types::{PromiseResult as VmPromiseResult, ReturnData};
pub type PromiseIndex = u64;
pub type ReceiptIndex = u64;
pub type IteratorIndex = u64;
#[derive(Debug, PartialEq)]
pub enum PromiseResult {
NotReady,
Successful(Vec<u8>),
Failed,
}
#[cfg(not(target_arch = "wasm32"))]
impl From<PromiseResult> for VmPromiseResult {
fn from(p: PromiseResult) -> Self {
match p {
PromiseResult::NotReady => Self::NotReady,
PromiseResult::Successful(v) => Self::Successful(v),
PromiseResult::Failed => Self::Failed,
}
}
}
#[non_exhaustive]
#[derive(Debug, PartialEq)]
pub enum PromiseError {
Failed,
NotReady,
}