geth_tracer/gas.rs
1/// Helper [Inspector] that keeps track of gas.
2#[derive(Clone, Copy, Debug, Default)]
3pub struct GasInspector {
4 gas_remaining: u64,
5 last_gas_cost: u64,
6}
7
8impl GasInspector {
9 pub fn gas_remaining(&self) -> u64 { self.gas_remaining }
10
11 pub fn last_gas_cost(&self) -> u64 { self.last_gas_cost }
12
13 pub fn set_gas_remainning(&mut self, remainning: u64) {
14 self.gas_remaining = remainning;
15 }
16
17 pub fn set_last_gas_cost(&mut self, gas_cost: u64) {
18 self.last_gas_cost = gas_cost;
19 }
20}