Function std::registers::context_gas
pub fn context_gas() -> u64
Expand description
Remaining gas in the context.
Returns
- [u64] - The remaining gas for the current context.
Examples
use std::registers::context_gas;
fn foo() {
let gas = context_gas();
let gas_2 = bar();
assert(gas_2 < gas);
}
fn bar() -> u64 {
context_gas();
}