From 358f7205936741978744cbde53a3f2e097ab2b77 Mon Sep 17 00:00:00 2001 From: chalith Date: Wed, 3 Apr 2024 13:27:10 +0530 Subject: [PATCH] Opt in to reputation --- reputationd/lib/reputationd.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reputationd/lib/reputationd.js b/reputationd/lib/reputationd.js index f23718e..0d8cdc1 100644 --- a/reputationd/lib/reputationd.js +++ b/reputationd/lib/reputationd.js @@ -15,7 +15,7 @@ class ReputationD { #reputationRetryDelay = 300000; // 5 mins #reputationRetryCount = 3; #feeUpliftment = 0; - #reportTimeQuota = 0.65; // Percentage of moment size. + #reportTimeQuota = 0.9; // Percentage of moment size. #contractInitTimeQuota = 0.1; // Percentage of moment size. #scoreFilePath = `/home/#USER#/#INSTANCE#/contract_fs/mnt/opinion.txt` @@ -383,7 +383,7 @@ class ReputationD { async #getScores() { const instanceName = this.cfg.contractInstance.name; if (!instanceName) - throw 'No available reputation contract running.'; + return null; const instances = await CliHelper.listInstances(); @@ -393,13 +393,13 @@ class ReputationD { this.cfg.contractInstance = {}; this.#persistConfig(); - throw 'No contract instance matching with the configuration.'; + return null; } const path = this.#scoreFilePath.replace('#USER#', instance.user).replace('#INSTANCE#', instance.name); if (!fs.existsSync(path)) - throw 'Scores file does not exist.'; + return null; return JSON.parse(path); }