From 16411afaaa97c1730ba1854b81eb6ca34a10ab03 Mon Sep 17 00:00:00 2001
From: inso <insomniak.fr@gmaiL.com>
Date: Thu, 17 Mar 2016 20:12:58 +0100
Subject: [PATCH] Removed BlockUID method (should use network blockUID)

---
 src/sakia/core/community.py | 25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/src/sakia/core/community.py b/src/sakia/core/community.py
index bfdfbd4c..cf4ee97e 100644
--- a/src/sakia/core/community.py
+++ b/src/sakia/core/community.py
@@ -241,7 +241,7 @@ class Community(QObject):
         Get the community network instance.
 
         :return: The community network instance.
-        :rtype: sakia.core.net.network.Network
+        :rtype: sakia.core.net.Network
         """
         return self._network
 
@@ -261,13 +261,15 @@ class Community(QObject):
         """
         return await self.bma_access.future_request(bma.blockchain.Parameters)
 
-    async def certification_expired(self, certtime):
+    async def certification_expired(self, cert_time):
         """
         Return True if the certificaton time is too old
+
+        :param int cert_time: the timestamp of the certification
         """
         parameters = await self.parameters()
         blockchain_time = await self.time()
-        return blockchain_time - certtime > parameters['sigValidity']
+        return blockchain_time - cert_time > parameters['sigValidity']
 
     def add_node(self, node):
         """
@@ -301,23 +303,6 @@ class Community(QObject):
                                 req_args={'number': number})
         return data
 
-    async def blockUID(self):
-        """
-        Get the block id.
-
-        :return: The current block ID as [NUMBER-HASH] format.
-        """
-        try:
-            block_number = self.network.current_blockUID.number
-            block = await self.bma_access.future_request(bma.blockchain.Block,
-                                 req_args={'number': block_number})
-            signed_raw = "{0}{1}\n".format(block['raw'], block['signature'])
-        except ValueError as e:
-            if '404' in str(e):
-                return BlockUID.empty()
-
-        return Block.from_signed_raw(signed_raw).blockUID
-
     async def members_pubkeys(self):
         """
         Listing members pubkeys of a community
-- 
GitLab