#![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 component;
pub mod crypto_utils;
pub mod engine;
pub mod modules;
pub mod prelude;
pub mod resource;
pub mod runtime;
mod macros;
extern crate scrypto_derive;
pub use scrypto_derive::{blueprint, NonFungibleData};
extern crate radix_engine_interface;
pub use radix_engine_interface::{
address, api, blueprints, constants, crypto, data, math, network, schema, time, types,
};
pub extern crate self as scrypto;
pub fn set_up_panic_hook() {
#[cfg(not(feature = "alloc"))]
std::panic::set_hook(Box::new(|info| {
let mut message = String::new();
if let Some(s) = info.payload().downcast_ref::<&str>() {
message.push_str(s);
} else if let Some(s) = info.payload().downcast_ref::<String>() {
message.push_str(s);
} else {
message.push_str("Panic")
}
message.push_str(" @ ");
if let Some(l) = info.location() {
message.push_str(l.file());
message.push_str(":");
message.push_str(&l.line().to_string());
message.push_str(":");
message.push_str(&l.column().to_string());
} else {
message.push_str("<unknown>");
};
crate::runtime::Runtime::panic(message);
}));
}
#[cfg(all(feature = "coverage"))]
#[no_mangle]
pub unsafe extern "C" fn dump_coverage() -> types::Slice {
let mut coverage = vec![];
minicov::capture_coverage(&mut coverage).unwrap();
engine::wasm_api::forget_vec(coverage)
}