Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(core_intrinsics))]
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]

#[cfg(not(feature = "std"))]
Expand Down Expand Up @@ -56,14 +55,14 @@ mod contract {
#[panic_handler]
#[no_mangle]
pub unsafe fn on_panic(_info: &::core::panic::PanicInfo) -> ! {
::core::intrinsics::abort();
::core::arch::wasm32::unreachable();
}

#[cfg(target_arch = "wasm32")]
#[alloc_error_handler]
#[no_mangle]
pub unsafe fn on_alloc_error(_: core::alloc::Layout) -> ! {
::core::intrinsics::abort();
::core::arch::wasm32::unreachable();
}

///
Expand Down
3 changes: 1 addition & 2 deletions src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,8 @@ pub fn assert_private_call() {
}

pub fn attached_deposit() -> u128 {
use core::intrinsics::size_of;
unsafe {
let data = [0u8; size_of::<u128>()];
let data = [0u8; core::mem::size_of::<u128>()];
exports::attached_deposit(data.as_ptr() as u64);
u128::from_le_bytes(data)
}
Expand Down