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
41
42
43
44
use crate::{ActionCosts, ExtCosts};
use serde::{Deserialize, Serialize};
use std::cell::RefCell;
use std::rc::Rc;
pub type AccountId = String;
pub type PublicKey = Vec<u8>;
pub type BlockHeight = u64;
pub type EpochHeight = u64;
pub type Balance = u128;
pub type Gas = u64;
pub type PromiseIndex = u64;
pub type ReceiptIndex = u64;
pub type IteratorIndex = u64;
pub type StorageUsage = u64;
pub type ProtocolVersion = u32;
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub enum ReturnData {
#[serde(with = "crate::serde_with::bytes_as_str")]
Value(Vec<u8>),
ReceiptIndex(ReceiptIndex),
None,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum PromiseResult {
NotReady,
#[serde(with = "crate::serde_with::bytes_as_str")]
Successful(Vec<u8>),
Failed,
}
pub type ProfileData = Rc<RefCell<[u64; ActionCosts::count() + ExtCosts::count()]>>;