Function reth_rpc_eth_types::revm_utils::caller_gas_allowance
source ยท pub fn caller_gas_allowance<DB>(db: &mut DB, env: &TxEnv) -> EthResult<U256>where
DB: Database,
EthApiError: From<<DB as Database>::Error>,
Expand description
Calculates the caller gas allowance.
allowance = (account.balance - tx.value) / tx.gas_price
Returns an error if the caller has insufficient funds.
Caution: This assumes non-zero env.gas_price
. Otherwise, zero allowance will be returned.