Пример #1
0
        public async Task <IActionResult> TransactionDetailsByHash(string hash)
        {
            if (!CommonHelpers.IsValidHash(hash))
            {
                return(BadRequest("Incorect format of the hash")); //return 400
            }

            HashSet <TransactionContainer> res;

            try
            {
                // get a list of transactions to the given address
                res = await _repository.GetDetailedTransactionByHash(hash);
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Error occured in " + nameof(TransactionDetailsByHash));
                return(StatusCode(504));
            }

            return(Json(res)); // it will be only one transation and so no ordering
        }