unc_sdk/types/
vm_types.rs1#[cfg(all(not(target_arch = "wasm32"), feature = "unit-testing"))]
2pub use unc_vm_runner::logic::types::{PromiseResult as VmPromiseResult, ReturnData};
3
4#[derive(Debug, Eq, PartialEq, PartialOrd, Ord, Hash, Copy, Clone)]
7pub struct PromiseIndex(pub(crate) u64);
8
9#[deprecated(since = "2.1.0", note = "type not used within SDK, use u64 directly or another alias")]
11pub type ReceiptIndex = u64;
12#[deprecated(since = "2.1.0", note = "type not used within SDK, use u64 directly or another alias")]
13pub type IteratorIndex = u64;
14
15#[derive(Debug, PartialEq, Eq)]
18pub enum PromiseResult {
19 Successful(Vec<u8>),
20 Failed,
21}
22
23#[cfg(all(not(target_arch = "wasm32"), feature = "unit-testing"))]
24impl From<PromiseResult> for VmPromiseResult {
25 fn from(p: PromiseResult) -> Self {
26 match p {
27 PromiseResult::Successful(v) => Self::Successful(v),
28 PromiseResult::Failed => Self::Failed,
29 }
30 }
31}
32
33#[non_exhaustive]
35#[derive(Debug, PartialEq, Eq)]
36pub enum PromiseError {
37 Failed,
39}