#[cfg_attr(target_arch = "wasm32", link(wasm_import_module = "concordium"))]
extern "C" {
pub(crate) fn accept() -> u32;
pub(crate) fn simple_transfer(addr_bytes: *const u8, amount: u64) -> u32;
pub(crate) fn send(
addr_index: u64,
addr_subindex: u64,
receive_name: *const u8,
receive_name_len: u32,
amount: u64,
parameter: *const u8,
parameter_len: u32,
) -> u32;
pub(crate) fn combine_and(l: u32, r: u32) -> u32;
pub(crate) fn combine_or(l: u32, r: u32) -> u32;
pub(crate) fn get_parameter_size() -> u32;
pub(crate) fn get_parameter_section(param_bytes: *mut u8, length: u32, offset: u32) -> u32;
pub(crate) fn get_policy_section(policy_bytes: *mut u8, length: u32, offset: u32) -> u32;
pub(crate) fn log_event(start: *const u8, length: u32);
pub(crate) fn load_state(start: *mut u8, length: u32, offset: u32) -> u32;
pub(crate) fn write_state(start: *const u8, length: u32, offset: u32) -> u32;
pub(crate) fn resize_state(new_size: u32) -> u32; pub(crate) fn state_size() -> u32;
pub(crate) fn get_init_origin(start: *mut u8);
pub(crate) fn get_receive_invoker(start: *mut u8);
pub(crate) fn get_receive_self_address(start: *mut u8);
pub(crate) fn get_receive_self_balance() -> u64;
pub(crate) fn get_receive_sender(start: *mut u8);
pub(crate) fn get_receive_owner(start: *mut u8);
pub(crate) fn get_slot_time() -> u64;
#[cfg(all(feature = "wasm-test", target_arch = "wasm32"))]
pub(crate) fn report_error(
msg_start: *const u8,
msg_length: u32,
filename_start: *const u8,
filename_length: u32,
line: u32,
column: u32,
);
}
#[cfg(not(target_arch = "wasm32"))]
mod host_dummy_functions {
#[no_mangle]
pub(crate) extern "C" fn accept() -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn simple_transfer(_addr_bytes: *const u8, _amount: u64) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn send(
_addr_index: u64,
_addr_subindex: u64,
_receive_name: *const u8,
_receive_name_len: u32,
_amount: u64,
_parameter: *const u8,
_parameter_len: u32,
) -> u32 {
panic!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn combine_and(_l: u32, _r: u32) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn combine_or(_l: u32, _r: u32) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_parameter_size() -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_parameter_section(
_param_bytes: *mut u8,
_length: u32,
_offset: u32,
) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_policy_section(
_policy_bytes: *mut u8,
_length: u32,
_offset: u32,
) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn log_event(_start: *const u8, _length: u32) {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn load_state(_start: *mut u8, _length: u32, _offset: u32) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn write_state(_start: *const u8, _length: u32, _offset: u32) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn resize_state(_new_size: u32) -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn state_size() -> u32 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_init_origin(_start: *mut u8) {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_receive_invoker(_start: *mut u8) {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_receive_self_address(_start: *mut u8) {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_receive_self_balance() -> u64 {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_receive_sender(_start: *mut u8) {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_receive_owner(_start: *mut u8) {
unimplemented!("Dummy function! Not to be executed")
}
#[no_mangle]
pub(crate) extern "C" fn get_slot_time() -> u64 {
unimplemented!("Dummy function! Not to be executed")
}
}