diff --git a/Cargo.toml b/Cargo.toml index 786cbbd3..328cc909 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,4 +32,5 @@ default-features = false [features] default = [] kip4 = [] +kip6 = [] std = ["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 }