Skip to content
This repository has been archived by the owner on Feb 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from paritytech/kip6-feature
Browse files Browse the repository at this point in the history
Add the kip6 feature gate
  • Loading branch information
lexfrl authored Aug 21, 2018
2 parents 65ccb87 + 4888c46 commit 85c909e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ default-features = false
[features]
default = []
kip4 = []
kip6 = []
std = ["pwasm-std/std", "parity-hash/std", "uint/std", "byteorder/std"]
2 changes: 2 additions & 0 deletions src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 85c909e

Please sign in to comment.