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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(any(feature = "std", feature = "alloc")))]
compile_error!("Either feature `std` or `alloc` must be enabled for this crate.");
#[cfg(all(feature = "std", feature = "alloc"))]
compile_error!("Feature `std` and `alloc` can't be enabled at the same time.");
pub mod abi {
pub use scrypto_abi::*;
}
pub mod component;
pub mod runtime;
pub mod data {
pub use radix_engine_interface::data::*;
}
pub mod math {
pub use radix_engine_interface::math::*;
}
pub mod model {
pub use radix_engine_interface::model::*;
}
pub mod crypto {
pub use radix_engine_interface::crypto::*;
}
pub mod engine;
pub mod resource;
#[cfg(feature = "prelude")]
pub mod prelude;
mod macros;
pub use macros::*;
pub extern crate radix_engine_derive;
pub use radix_engine_derive::{
LegacyDescribe, NonFungibleData, ScryptoCategorize, ScryptoDecode, ScryptoEncode,
};
extern crate scrypto_derive;
pub use scrypto_derive::{blueprint, import};
pub extern crate radix_engine_interface;
pub extern crate scrypto_abi;
extern crate self as scrypto;
pub fn set_up_panic_hook() {
#[cfg(not(feature = "alloc"))]
std::panic::set_hook(Box::new(|info| {
let payload = info
.payload()
.downcast_ref::<&str>()
.map(ToString::to_string)
.or(info
.payload()
.downcast_ref::<String>()
.map(ToString::to_string))
.unwrap_or(String::new());
let location = if let Some(l) = info.location() {
format!("{}:{}:{}", l.file(), l.line(), l.column())
} else {
"<unknown>".to_owned()
};
crate::runtime::Logger::error(sbor::rust::format!(
"Panicked at '{}', {}",
payload,
location
));
}));
}