public ResultWrapper <TransactionReceipt> eth_getTransactionReceipt(Data transactionHash) { var transactionReceipt = _blockchainBridge.GetTransactionReceipt(new Keccak(transactionHash.Value)); if (transactionReceipt == null) { return(ResultWrapper <TransactionReceipt> .Fail($"Cannot find transactionReceipt for transaction hash: {transactionHash.Value}", ErrorType.NotFound)); } var transaction = _blockchainBridge.GetTransaction(new Keccak(transactionHash.Value)); if (transaction == null) { return(ResultWrapper <TransactionReceipt> .Fail($"Cannot find transaction for hash: {transactionHash.Value}", ErrorType.NotFound)); } var blockHash = _blockchainBridge.GetBlockHash(new Keccak(transactionHash.Value)); if (blockHash == null) { return(ResultWrapper <TransactionReceipt> .Fail($"Cannot find block hash for transaction: {transactionHash.Value}", ErrorType.NotFound)); } var block = _blockchainBridge.FindBlock(blockHash, false); if (block == null) { return(ResultWrapper <TransactionReceipt> .Fail($"Cannot find block for hash: {blockHash}", ErrorType.NotFound)); } var transactionReceiptModel = _modelMapper.MapTransactionReceipt(transactionReceipt, transaction, block); if (Logger.IsTrace) { Logger.Trace($"eth_getTransactionReceipt request {transactionHash.ToJson()}, result: {GetJsonLog(transactionReceiptModel.ToJson())}"); } return(ResultWrapper <TransactionReceipt> .Success(transactionReceiptModel)); }
public ResultWrapper <TransactionReceipt> eth_getTransactionReceipt(Data txHashData) { Keccak txHash = new Keccak(txHashData.Value); var transactionReceipt = _blockchainBridge.GetTransactionReceipt(txHash); if (transactionReceipt == null) { return(ResultWrapper <TransactionReceipt> .Fail($"Cannot find transactionReceipt for transaction hash: {txHash}", ErrorType.NotFound)); } var transactionReceiptModel = _modelMapper.MapTransactionReceipt(txHash, transactionReceipt); if (Logger.IsTrace) { Logger.Trace($"eth_getTransactionReceipt request {txHashData.ToJson()}, result: {GetJsonLog(transactionReceiptModel.ToJson())}"); } return(ResultWrapper <TransactionReceipt> .Success(transactionReceiptModel)); }