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

Add the kip6 feature gate #15

Merged
merged 2 commits into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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