private Optional<TransactionReceiptWithMetadata> getReceipt(
      final DataFetchingEnvironment environment) {
    if (transactionReceiptWithMetadata == null) {
      final BlockchainQueries query = getBlockchainQueries(environment);
      final ProtocolSchedule protocolSchedule =
          environment.getGraphQlContext().get(GraphQLContextType.PROTOCOL_SCHEDULE);

      final Transaction transaction = transactionWithMetadata.getTransaction();
      if (transaction == null) {
        transactionReceiptWithMetadata = Optional.empty();
      } else {
        transactionReceiptWithMetadata =
            query.transactionReceiptByTransactionHash(transaction.getHash(), protocolSchedule);
      }
    }
    return transactionReceiptWithMetadata;
  }
Reurns the receipt of the transaction.

@param environment the data fetching environment.
@return the receipt of the transaction.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java