pub fn create_gas_report(&self) -> GasReport {
        let state = self.env.with_gas_state(|gas_state| gas_state.clone());
        let gas_left = self.env.get_gas_left();
        GasReport {
            limit: state.gas_limit,
            remaining: gas_left,
            used_externally: state.externally_used_gas,
            // If externally_used_gas exceeds the gas limit, this will return 0.
            // no matter how much gas was used internally. But then we error with out of gas
            // anyways, and it does not matter much anymore where gas was spend.
            used_internally: state
                .gas_limit
                .saturating_sub(state.externally_used_gas)
                .saturating_sub(gas_left),
        }
    }
/// Creates and returns a gas report.
/// This is a snapshot and multiple reports can be created during the lifetime of
/// an instance.
Creates and returns a gas report.
This is a snapshot and multiple reports can be created during the lifetime of
an instance.
Creates and returns a gas report . This is a snapshot and multiple reports can be created during the lifetime of an instance .
pub fn create_gas_report(&self) -> GasReport {
        let state = self.env.with_gas_state(|gas_state| gas_state.clone());
        let gas_left = self.env.get_gas_left();
        GasReport {
            limit: state.gas_limit,
            remaining: gas_left,
            used_externally: state.externally_used_gas,
            // If externally_used_gas exceeds the gas limit, this will return 0.
            // no matter how much gas was used internally. But then we error with out of gas
            // anyways, and it does not matter much anymore where gas was spend.
            used_internally: state
                .gas_limit
                .saturating_sub(state.externally_used_gas)
                .saturating_sub(gas_left),
        }
    }
pub fn create_gas_report ( & self ) -> GasReport { let state = self . env . with_gas_state ( | gas_state | gas_state . clone ( ) ) ; let gas_left = self . env . get_gas_left ( ) ; GasReport { limit : state . gas_limit , remaining : gas_left , used_externally : state . externally_used_gas , // If externally_used_gas exceeds the gas limit, this will return 0. // no matter how much gas was used internally. But then we error with out of gas // anyways, and it does not matter much anymore where gas was spend. used_internally : state . gas_limit . saturating_sub ( state . externally_used_gas ) . saturating_sub ( gas_left ) , } }
Creates and returns a gas report.
Creates and returns a gas report .
&self