From 1bd78937ceb8ca5e2a3d05fd57909cfda8294146 Mon Sep 17 00:00:00 2001 From: mbraidot <mbraidot@buenosaires.gob.ar> Date: Tue, 16 Apr 2019 16:39:08 -0300 Subject: [PATCH] =?UTF-8?q?Se=20muestra=20el=20address=20que=20firm=C3=B3?= =?UTF-8?q?=20la=20transacci=C3=B3n=20en=20la=20respuesta=20al=20m=C3=A9to?= =?UTF-8?q?do=20verify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/app/views.py b/api/app/views.py index 93b32ec..9405799 100644 --- a/api/app/views.py +++ b/api/app/views.py @@ -137,6 +137,7 @@ class Verify(APIView): permanent_ots = PERMANENT_OTS_PREFIX + '-' + file_hash + '-' + ots_hash + '-' + tx_hash + '-' + str(block_number) return Response({_('status'): _('success'), + _('from'): transaction['from'], _('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8'), _('messages'): _('file_uploaded') % ( file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp)))}, @@ -157,9 +158,16 @@ class Verify(APIView): block_number = TimestampManager.get_block_number(contract_version, ots_hash) block = TimestampManager.get_block(block_number) + transaction = TimestampManager.get_transaction(tx_hash) + permanent_ots = PERMANENT_OTS_PREFIX + '-' + file_hash + '-' + ots_hash + '-' + tx_hash + '-' + str(block_number) - return Response({_('status'): _('success'), _('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8') ,_('messages'): _('file_uploaded') % (file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp)))},status=status.HTTP_200_OK) + return Response({ + _('status'): _('success'), + _('from'): transaction['from'], + _('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8'), + _('messages'): _('file_uploaded') % (file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp))) + },status=status.HTTP_200_OK) else: try: transaction = TimestampManager.get_transaction(tx_hash) -- GitLab