Skip to content

Commit

Permalink
add panics
Browse files Browse the repository at this point in the history
  • Loading branch information
saeed-zil committed Jun 27, 2024
1 parent ff75d10 commit 8c4ae6e
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions crates/sdk/src/sys/mock.rs
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
use super::types::*;

#[no_mangle]
extern "C" fn panic(loc: Location) -> ! {
todo!()
extern "C" fn panic(_loc: Location) -> ! {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn panic_utf8(msg: Buffer, loc: Location) -> ! {
todo!()
extern "C" fn panic_utf8(_msg: Buffer, _loc: Location) -> ! {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn register_len(register_id: RegisterId) -> PtrSizedInt {
todo!()
extern "C" fn register_len(_register_id: RegisterId) -> PtrSizedInt {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn read_register(register_id: RegisterId, buf: BufferMut) -> Bool {
todo!()
extern "C" fn read_register(_register_id: RegisterId, _buf: BufferMut) -> Bool {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn input(register_id: RegisterId) {
todo!()
extern "C" fn input(_register_id: RegisterId) {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn value_return(value: ValueReturn) {
todo!()
extern "C" fn value_return(_value: ValueReturn) {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn log_utf8(msg: Buffer) {
todo!()
extern "C" fn log_utf8(_msg: Buffer) {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn emit(event: Event) {
todo!()
extern "C" fn emit(_event: Event) {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn storage_read(key: Buffer, register_id: RegisterId) -> Bool {
todo!()
extern "C" fn storage_read(_key: Buffer, _register_id: RegisterId) -> Bool {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn storage_write(key: Buffer, value: Buffer, register_id: RegisterId) -> Bool {
todo!()
extern "C" fn storage_write(_key: Buffer, _value: Buffer, _register_id: RegisterId) -> Bool {
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

#[no_mangle]
extern "C" fn fetch(
url: Buffer,
method: Buffer,
headers: Buffer,
body: Buffer,
register_id: RegisterId,
_url: Buffer,
_method: Buffer,
_headers: Buffer,
_body: Buffer,
_register_id: RegisterId,
) -> Bool {
todo!()
panic!("Although your build was successful, it doesn't mean you're allowed to call this function in a non WASM target!")
}

0 comments on commit 8c4ae6e

Please sign in to comment.