Skip to content

Commit e5669bd

Browse files
committed
Fix compilation issues in the debug API
1 parent 5524b91 commit e5669bd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/debug.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! The native debug interface exposed to the ewasm contract. These functions are for testing
22
//! purposes only. On a live VM, any bytecode trying to import these symbols will be rejected.
33
4+
use crate::types::*;
5+
46
mod native {
57
extern "C" {
68
pub fn debug_print32(value: u32);
@@ -16,16 +18,16 @@ pub fn print32(value: u32) {
1618
unsafe { native::debug_print32(value) }
1719
}
1820

19-
pub fn print64(value: u32) {
21+
pub fn print64(value: u64) {
2022
unsafe { native::debug_print64(value) }
2123
}
2224

2325
pub fn printMem(slice: &[u8]) {
24-
unsafe { native::debug_printMem(slice.bytes.as_ptr() as *const u32, slice.len()) }
26+
unsafe { native::debug_printMem(slice.as_ptr() as *const u32, slice.len() as u32) }
2527
}
2628

2729
pub fn printMemHex(slice: &[u8]) {
28-
unsafe { native::debug_printMem(slice.bytes.as_ptr() as *const u32, slice.len()) }
30+
unsafe { native::debug_printMem(slice.as_ptr() as *const u32, slice.len() as u32) }
2931
}
3032

3133
pub fn printStorage(key: &StorageKey) {

0 commit comments

Comments
 (0)