fn transaction_call(
        &self,
        request: &web3::CallRequest,
        block_id: BlockId,
    ) -> Option<Result<web3::Bytes, ClientError>> {
        if request.gas.is_none() || request.value.is_none() {
            return None;
        }
        let data = request.data.as_ref()?;

        // Check if any of sent transactions match the request parameters
        let executed_tx = self.sent_txs.iter().find_map(|(hash, (tx, _))| {
            if request.to != Some(tx.recipient) || data.0 != tx.input {
                return None;
            }
            let executed_tx = self.executed_txs.get(hash)?;
            let expected_block_number = executed_tx.receipt.block_number.unwrap();
            (block_id == BlockId::Number(expected_block_number.into())).then_some(executed_tx)
        })?;

        Some(if executed_tx.success {
            Ok(web3::Bytes(vec![1]))
        } else {
            // The error code is arbitrary
            Err(ClientError::Call(ErrorObject::owned(
                3,
                "execution reverted: oops",
                None::<()>,
            )))
        })
    }
Processes a transaction-like `eth_call` which is used in `EthInterface::failure_reason()`.
core/lib/eth_client/src/clients/mock.rs