fn charge_gas_storage(&mut self, bytes_count: usize) -> Result<(), Error> {
        if let Some(base_key) = self.base_key().into_hash() {
            let contract_hash = ContractHash::new(base_key);
            if self.is_system_contract(&contract_hash)? {
                // Don't charge storage used while executing a system contract.
                return Ok(());
            }
        }

        let storage_costs = self.engine_config().wasm_config().storage_costs();

        let gas_cost = storage_costs.calculate_gas_cost(bytes_count);

        self.charge_gas(gas_cost)
    }
/// Charges gas for specified amount of bytes used.
Charges gas for specified amount of bytes used.
Charges gas for specified amount of bytes used .
fn charge_gas_storage(&mut self, bytes_count: usize) -> Result<(), Error> {
        if let Some(base_key) = self.base_key().into_hash() {
            let contract_hash = ContractHash::new(base_key);
            if self.is_system_contract(&contract_hash)? {
                // Don't charge storage used while executing a system contract.
                return Ok(());
            }
        }
        let storage_costs = self.engine_config().wasm_config().storage_costs();
        let gas_cost = storage_costs.calculate_gas_cost(bytes_count);
        self.charge_gas(gas_cost)
    }
fn charge_gas_storage ( & mut self , bytes_count : usize ) -> Result < ( ) , Error > { if let Some ( base_key ) = self . base_key ( ) . into_hash ( ) { let contract_hash = ContractHash :: new ( base_key ) ; if self . is_system_contract ( & contract_hash ) ? { // Don't charge storage used while executing a system contract. return Ok ( ( ) ) ; } } let storage_costs = self . engine_config ( ) . wasm_config ( ) . storage_costs ( ) ; let gas_cost = storage_costs . calculate_gas_cost ( bytes_count ) ; self . charge_gas ( gas_cost ) }
Charges gas for specified amount of bytes used.
Charges gas for specified amount of bytes used .
&mut self
bytes_count
usize
&mut self
bytes_count
usize