Function reth::rpc::server_types::eth::revm_utils::caller_gas_allowance

source ยท
pub fn caller_gas_allowance<DB>(
    db: &mut DB,
    env: &TxEnv,
) -> Result<Uint<256, 4>, EthApiError>
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.