Skip to content

Commit f9cb1f7

Browse files
authored
Merge pull request #31 from cryptape/use-generic-library-feature
Use a generic `library` feature to setup contract
2 parents 745127f + a006747 commit f9cb1f7

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

contract/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ edition = "2021"
77
ckb-std = "0.17.0"
88

99
[features]
10-
native-simulator = ["ckb-std/native-simulator"]
10+
library = []
11+
native-simulator = ["library", "ckb-std/native-simulator"]

contract/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#![cfg_attr(not(feature = "native-simulator"), no_std)]
1+
#![cfg_attr(not(feature = "library"), no_std)]
22
#![allow(special_module_name)]
33
#![allow(unused_attributes)]
4-
#[cfg(feature = "native-simulator")]
4+
#[cfg(feature = "library")]
55
mod main;
6-
#[cfg(feature = "native-simulator")]
6+
#[cfg(feature = "library")]
77
pub use main::program_entry;
88

99
extern crate alloc;

contract/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#![cfg_attr(not(any(feature = "native-simulator", test)), no_std)]
1+
#![cfg_attr(not(any(feature = "library", test)), no_std)]
22
#![cfg_attr(not(test), no_main)]
33

4-
#[cfg(any(feature = "native-simulator", test))]
4+
#[cfg(any(feature = "library", test))]
55
extern crate alloc;
66

7-
#[cfg(not(any(feature = "native-simulator", test)))]
7+
#[cfg(not(any(feature = "library", test)))]
88
ckb_std::entry!(program_entry);
9-
#[cfg(not(any(feature = "native-simulator", test)))]
9+
#[cfg(not(any(feature = "library", test)))]
1010
// By default, the following heap configuration is used:
1111
// * 16KB fixed heap
1212
// * 1.2MB(rounded up to be 16-byte aligned) dynamic heap

0 commit comments

Comments
 (0)