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

            HashSet <string> res;

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

            return(Json(res));
        }