diff --git a/circle.yml b/circle.yml index fc01e76..c1c1c1f 100644 --- a/circle.yml +++ b/circle.yml @@ -23,4 +23,10 @@ jobs: command: cargo test --target=x86_64-unknown-linux-gnu - run: name: Build - command: cargo build --release + command: | + cargo build --release + # debug + cargo build + cargo build --release --no-default-features + cargo build --release --features debug + cargo build --release --no-default-features --features debug diff --git a/src/debug.rs b/src/debug.rs index 5c20b9f..0678c81 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -1,6 +1,8 @@ //! The native debug interface exposed to the ewasm contract. These functions are for testing //! purposes only. On a live VM, any bytecode trying to import these symbols will be rejected. +use crate::types::*; + mod native { extern "C" { pub fn debug_print32(value: u32); @@ -16,16 +18,16 @@ pub fn print32(value: u32) { unsafe { native::debug_print32(value) } } -pub fn print64(value: u32) { +pub fn print64(value: u64) { unsafe { native::debug_print64(value) } } pub fn printMem(slice: &[u8]) { - unsafe { native::debug_printMem(slice.bytes.as_ptr() as *const u32, slice.len()) } + unsafe { native::debug_printMem(slice.as_ptr() as *const u32, slice.len() as u32) } } pub fn printMemHex(slice: &[u8]) { - unsafe { native::debug_printMem(slice.bytes.as_ptr() as *const u32, slice.len()) } + unsafe { native::debug_printMem(slice.as_ptr() as *const u32, slice.len() as u32) } } pub fn printStorage(key: &StorageKey) {