#![cfg_attr(target_arch = "wasm32", no_std)]
#![cfg_attr(
all(target_arch = "wasm32", feature = "oom-handler"),
feature(alloc_error_handler)
)]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![deny(dead_code, unused_mut)]
#![warn(missing_docs)]
pub mod env;
pub use near_sys as sys;
#[cfg(not(target_arch = "wasm32"))]
pub mod mock;
mod types;
pub use self::types::{AccountId, Balance, Gas};
#[cfg(all(feature = "wee_alloc", target_arch = "wasm32"))]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[cfg(all(not(feature = "std"), feature = "oom-handler", target_arch = "wasm32"))]
#[alloc_error_handler]
fn oom(_: core::alloc::Layout) -> ! {
core::arch::wasm32::unreachable()
}
#[cfg(all(target_arch = "wasm32", not(feature = "std")))]
#[panic_handler]
#[allow(unused_variables)]
fn panic(info: &core::panic::PanicInfo) -> ! {
if cfg!(feature = "panic-message") {
if let Some(s) = info.payload().downcast_ref::<&str>() {
env::panic_str(s);
} else {
env::panic_str("unexpected panic occurred");
}
} else {
core::arch::wasm32::unreachable()
}
}