From b983a23cf2ff9d20ee42dec97c4ab21356109273 Mon Sep 17 00:00:00 2001 From: fro Date: Tue, 21 Aug 2018 16:22:57 +0400 Subject: [PATCH 1/2] add the kip6 feature gate (make it default) --- Cargo.toml | 5 +++-- src/ext.rs | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 786cbbd3..8d9debd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ version = "1.2.2" default-features = false [features] -default = [] +default = ["kip6"] kip4 = [] -std = ["pwasm-std/std", "parity-hash/std", "uint/std", "byteorder/std"] +kip6 = [] +std = ["kip6", "pwasm-std/std", "parity-hash/std", "uint/std", "byteorder/std"] diff --git a/src/ext.rs b/src/ext.rs index 4e2ce0af..abf4623e 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -62,6 +62,7 @@ mod external { pub fn gaslimit(dest: *mut u8); + #[cfg(feature = "kip6")] pub fn gasleft() -> i64; pub fn sender(dest: *mut u8); @@ -255,6 +256,7 @@ pub fn gas_limit() -> U256 { unsafe { fetch_u256(|x| external::gaslimit(x) ) } } +#[cfg(feature = "kip6")] /// Get amount of gas left. pub fn gas_left() -> u64 { unsafe { external::gasleft() as u64 } From 4888c463544cac0d90c6d7158cc3177905225b05 Mon Sep 17 00:00:00 2001 From: fro Date: Tue, 21 Aug 2018 17:46:33 +0400 Subject: [PATCH 2/2] make kip6 not by default feature --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d9debd1..328cc909 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ version = "1.2.2" default-features = false [features] -default = ["kip6"] +default = [] kip4 = [] kip6 = [] -std = ["kip6", "pwasm-std/std", "parity-hash/std", "uint/std", "byteorder/std"] +std = ["pwasm-std/std", "parity-hash/std", "uint/std", "byteorder/std"]