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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
pub use handler::*;
#[cfg(target_family = "wasm")]
pub use ic::*;
pub use interface::*;
pub use mock::*;
mod handler;
#[cfg(target_family = "wasm")]
mod ic;
mod inject;
mod interface;
mod mock;
#[cfg(not(target_family = "wasm"))]
pub use async_std::test as async_test;
pub use ic_cdk::api::call::{CallResult, RejectionCode};
pub use ic_cdk::export::candid;
pub use ic_cdk::export::Principal;
pub use ic_cdk_macros as macros;
#[cfg(not(target_family = "wasm"))]
pub mod mock_principals {
use crate::Principal;
#[inline]
pub fn alice() -> Principal {
Principal::from_text("sgymv-uiaaa-aaaaa-aaaia-cai").unwrap()
}
#[inline]
pub fn bob() -> Principal {
Principal::from_text("ai7t5-aibaq-aaaaa-aaaaa-c").unwrap()
}
#[inline]
pub fn john() -> Principal {
Principal::from_text("hozae-racaq-aaaaa-aaaaa-c").unwrap()
}
#[inline]
pub fn xtc() -> Principal {
Principal::from_text("aanaa-xaaaa-aaaah-aaeiq-cai").unwrap()
}
}
pub mod interfaces;
#[inline(always)]
pub fn get_context() -> &'static mut impl Context {
#[cfg(not(target_family = "wasm"))]
return inject::get_context();
#[cfg(target_family = "wasm")]
return IcContext::context();
}