Example #1
0
    public Task <ResultWrapper <ReceiptForRpc> > eth_getTransactionReceipt(Keccak txHash)
    {
        (TxReceipt receipt, UInt256? effectiveGasPrice, int logIndexStart) = _blockchainBridge.GetReceiptAndEffectiveGasPrice(txHash);
        if (receipt == null)
        {
            return(Task.FromResult(ResultWrapper <ReceiptForRpc> .Success(null)));
        }

        if (_logger.IsTrace)
        {
            _logger.Trace($"eth_getTransactionReceipt request {txHash}, result: {txHash}");
        }
        return(Task.FromResult(ResultWrapper <ReceiptForRpc> .Success(new(txHash, receipt, effectiveGasPrice, logIndexStart))));
    }
Example #2
0
        public Task <ResultWrapper <ReceiptForRpc> > eth_getTransactionReceipt(Keccak txHash)
        {
            (TxReceipt Receipt, UInt256? EffectiveGasPrice)result = _blockchainBridge.GetReceiptAndEffectiveGasPrice(txHash);
            if (result.Receipt == null)
            {
                return(Task.FromResult(ResultWrapper <ReceiptForRpc> .Success(null)));
            }

            Keccak blockHash = result.Receipt.BlockHash;

            TxReceipt[]   receipts      = _receiptFinder.Get(blockHash !);
            int           logIndexStart = receipts.GetBlockLogFirstIndex(result.Receipt.Index);
            ReceiptForRpc receiptModel  = new(txHash, result.Receipt, result.EffectiveGasPrice, logIndexStart);

            if (_logger.IsTrace)
            {
                _logger.Trace($"eth_getTransactionReceipt request {txHash}, result: {txHash}");
            }
            return(Task.FromResult(ResultWrapper <ReceiptForRpc> .Success(receiptModel)));
        }