From 57df1d34614ded051cdf908fc8910bc2ac903743 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Tue, 17 Jan 2017 17:05:04 +0100
Subject: [PATCH] [enh] Cleaning some TODOs

---
 app/controllers/wot.js                | 2 --
 app/lib/cfs.js                        | 2 +-
 app/lib/computation/blockGenerator.js | 1 -
 app/lib/crypto/keyring.js             | 2 +-
 app/lib/dal/fileDAL.js                | 1 -
 app/lib/dup/indexer.js                | 2 +-
 6 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/app/controllers/wot.js b/app/controllers/wot.js
index 6a7d653cd..f60b97df4 100644
--- a/app/controllers/wot.js
+++ b/app/controllers/wot.js
@@ -104,7 +104,6 @@ function WOTBinding (server) {
         cert.sigDate = certifier.buid;
         cert.wasMember = true; // As we checked if(certified)
         if (!cert.cert_time) {
-          // TODO: would be more efficient to save medianTime on certification reception
           let certBlock = yield server.dal.getBlock(cert.block_number);
           cert.cert_time = {
             block: certBlock.number,
@@ -164,7 +163,6 @@ function WOTBinding (server) {
         cert.sigDate = certified.buid;
         cert.wasMember = true; // As we checked if(certified)
         if (!cert.cert_time) {
-          // TODO: would be more efficient to save medianTime on certification reception (note: now partially done with INDEX)
           let certBlock = yield server.dal.getBlock(cert.block_number);
           cert.cert_time = {
             block: certBlock.number,
diff --git a/app/lib/cfs.js b/app/lib/cfs.js
index e1821e79f..4d8a55804 100644
--- a/app/lib/cfs.js
+++ b/app/lib/cfs.js
@@ -196,7 +196,7 @@ function CFSCore(rootPath, qfs, parent) {
       return JSON.parse(data);
     } catch(err) {
       if (data && err.message.match(/^Unexpected token {/)) {
-        // TODO: this is a bug thrown during Unit Tests with MEMORY_MODE true...
+        // This is a bug thrown during Unit Tests with MEMORY_MODE true...
         return JSON.parse(data.match(/^(.*)}{.*/)[1] + '}');
       } else if (err.message.match(/^Unexpected end of input/)) {
         // Could not read, return empty object
diff --git a/app/lib/computation/blockGenerator.js b/app/lib/computation/blockGenerator.js
index 7922bd59f..fb7189157 100644
--- a/app/lib/computation/blockGenerator.js
+++ b/app/lib/computation/blockGenerator.js
@@ -348,7 +348,6 @@ function BlockGenerator(mainContext, prover) {
     if (!isIdentityLeaving) {
       if (!current) {
         // Look for certifications from initial joiners
-        // TODO: check if this is still working
         const certs = yield dal.certsNotLinkedToTarget(idHash);
         foundCerts = _.filter(certs, function(cert){
           // Add 'joiners && ': special case when block#0 not written ANd not joiner yet (avoid undefined error)
diff --git a/app/lib/crypto/keyring.js b/app/lib/crypto/keyring.js
index 19aa34157..070af5cb5 100644
--- a/app/lib/crypto/keyring.js
+++ b/app/lib/crypto/keyring.js
@@ -46,7 +46,7 @@ function Key(pub, sec) {
 
   this.signSync = (msg) => {
     const m = nacl.util.decodeUTF8(msg);
-    const signedMsg = naclBinding.sign(m, rawSec()); // TODO: super weird
+    const signedMsg = naclBinding.sign(m, rawSec());
     const sig = new Uint8Array(crypto_sign_BYTES);
     for (let i = 0; i < sig.length; i++) {
       sig[i] = signedMsg[i];
diff --git a/app/lib/dal/fileDAL.js b/app/lib/dal/fileDAL.js
index 186d15e61..be5d314ba 100644
--- a/app/lib/dal/fileDAL.js
+++ b/app/lib/dal/fileDAL.js
@@ -67,7 +67,6 @@ function FileDAL(params) {
     }
     logger.debug("Upgrade database...");
     yield that.metaDAL.upgradeDatabase();
-    // TODO: remove as of v1.0
     const latestMember = yield that.iindexDAL.getLatestMember();
     if (latestMember && that.wotb.getWoTSize() > latestMember.wotb_id + 1) {
       logger.warn('Maintenance: cleaning wotb...');
diff --git a/app/lib/dup/indexer.js b/app/lib/dup/indexer.js
index 2e0235489..da579a8a7 100644
--- a/app/lib/dup/indexer.js
+++ b/app/lib/dup/indexer.js
@@ -1484,7 +1484,7 @@ function median(values) {
     // Even number: the median is the average between the 2 central values, ceil rounded.
     const firstValue = values[nbValues / 2];
     const secondValue = values[nbValues / 2 - 1];
-    med = ((firstValue + secondValue) / 2); // TODO v1.0 median ceil rounded
+    med = ((firstValue + secondValue) / 2);
   } else {
     med = values[(nbValues + 1) / 2 - 1];
   }
-- 
GitLab