#![no_std]
extern crate alloc;
extern crate self as truthlinked_sdk;
pub mod abi;
pub mod backend;
pub mod call;
pub mod codec;
pub mod collections;
pub mod context;
pub mod env;
pub mod error;
pub mod hashing;
pub mod log;
pub mod manifest;
pub mod oracle;
pub mod storage;
#[cfg(any(test, feature = "testing"))]
pub mod testing;
pub use error::{Error, Result};
pub use truthlinked_sdk_macros::{error_code, require, BytesCodec, Codec32, Event, Manifest};
pub mod prelude {
pub use crate::abi;
pub use crate::backend::{HostStorage, MemoryStorage, StorageBackend};
pub use crate::call;
pub use crate::codec::{BytesCodec, Codec32, Decoder, Encoder};
pub use crate::collections::{Namespace, StorageBlob, StorageMap, StorageVec};
pub use crate::context;
pub use crate::env;
pub use crate::hashing;
pub use crate::log;
pub use crate::manifest::{ContractManifest, Manifest, ManifestBuilder, StorageKeySpec};
pub use crate::oracle;
pub use crate::storage::{self, Slot};
#[cfg(any(test, feature = "testing"))]
pub use crate::testing::{StorageHarness, TestBlob, TestMap, TestVec};
pub use crate::{
contract_entry, error_code, require, slot, BytesCodec, Codec32, Error, Event, Manifest,
Result,
};
}
#[macro_export]
macro_rules! contract_entry {
($handler:path) => {
#[no_mangle]
pub extern "C" fn execute() -> i32 {
match $handler() {
Ok(()) => 0,
Err(err) => err.code(),
}
}
};
}