Skip to content

Commit 22d33f8

Browse files
authored
Fix bug when contract not has features: native-simulatorg (#129)
* Fix bug when contract not has features: native-simulatorg
1 parent 5f8755a commit 22d33f8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

contracts/exec-callee/src/entry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use core::result::Result;
55
// https://nervosnetwork.github.io/ckb-std/riscv64imac-unknown-none-elf/doc/ckb_std/index.html
66

77
use crate::error::Error;
8+
extern crate alloc;
89

910
pub fn main() -> Result<(), Error> {
1011
let argv = ckb_std::env::argv();

src/debug.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,11 @@
3232
#[macro_export]
3333
macro_rules! debug {
3434
($fmt:literal) => {
35-
#[cfg(all(debug_assertions, feature = "native-simulator"))]
36-
$crate::syscalls::debug(format!($fmt));
37-
#[cfg(all(debug_assertions, not(feature = "native-simulator")))]
35+
#[cfg(debug_assertions)]
3836
$crate::syscalls::debug(alloc::format!($fmt));
3937
};
4038
($fmt:literal, $($args:expr),+) => {
41-
#[cfg(all(debug_assertions, feature = "native-simulator"))]
42-
$crate::syscalls::debug(format!($fmt, $($args), +));
43-
#[cfg(all(debug_assertions, not(feature = "native-simulator")))]
39+
#[cfg(debug_assertions)]
4440
$crate::syscalls::debug(alloc::format!($fmt, $($args), +));
4541
};
4642
}

0 commit comments

Comments
 (0)