#![cfg_attr(not(feature = "std"), no_std)]
#![deny(
missing_docs,
bad_style,
bare_trait_objects,
const_err,
improper_ctypes,
non_shorthand_field_patterns,
no_mangle_generic_items,
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
unconditional_recursion,
unused_allocation,
unused_comparisons,
unused_parens,
while_true,
trivial_casts,
trivial_numeric_casts,
unused_extern_crates
)]
#[cfg(all(not(feature = "std"), target_arch = "wasm32"))]
#[allow(unused_extern_crates)]
extern crate rlibc;
#[cfg(all(not(feature = "std"), target_arch = "wasm32"))]
#[allow(unused_variables)]
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
debug_print!("{}\n", info);
core::arch::wasm32::unreachable();
}
#[cfg(not(feature = "std"))]
extern crate ink_allocator;
mod api;
mod arithmetic;
mod backend;
pub mod call;
pub mod chain_extension;
mod engine;
mod error;
pub mod hash;
#[doc(hidden)]
pub mod topics;
mod types;
#[cfg(test)]
mod tests;
#[cfg(any(feature = "std", test, doc))]
#[doc(inline)]
pub use self::engine::off_chain::test_api as test;
use self::backend::{
EnvBackend,
TypedEnvBackend,
};
pub use self::{
api::*,
backend::{
CallFlags,
ReturnFlags,
},
error::{
Error,
Result,
},
topics::Topics,
types::{
AccountId,
Clear,
DefaultEnvironment,
Environment,
FromLittleEndian,
Hash,
NoChainExtension,
},
};
cfg_if::cfg_if! {
if #[cfg(any(feature = "ink-debug", feature = "std"))] {
#[doc(hidden)]
pub use ink_prelude::format;
#[macro_export]
macro_rules! debug_print {
($($arg:tt)*) => ($crate::debug_message(&$crate::format!($($arg)*)));
}
#[macro_export]
macro_rules! debug_println {
() => ($crate::debug_print!("\n"));
($($arg:tt)*) => (
$crate::debug_print!("{}\n", $crate::format!($($arg)*));
)
}
} else {
#[macro_export]
macro_rules! debug_print {
($($arg:tt)*) => ();
}
#[macro_export]
macro_rules! debug_println {
() => ();
($($arg:tt)*) => ();
}
}
}