From 1dae7478bd2a6ba3753aad29a06d648f37fe762c Mon Sep 17 00:00:00 2001 From: NZT48 Date: Fri, 21 Jun 2024 13:34:42 +0200 Subject: [PATCH] Resolve lint errors --- constants.js | 1 + managers/paranet-operations-manager.js | 15 +++++++++++---- .../blockchain-service/blockchain-service-base.js | 7 ++++++- services/validation-service.js | 6 +++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/constants.js b/constants.js index 435f94d7..bc6f4676 100644 --- a/constants.js +++ b/constants.js @@ -229,6 +229,7 @@ module.exports = { ASSERTION_STATES, CONTENT_TYPES, GET_OUTPUT_FORMATS, + INCENTIVE_TYPE, ASSET_STATES, STORE_TYPES, GRAPH_LOCATIONS, diff --git a/managers/paranet-operations-manager.js b/managers/paranet-operations-manager.js index bdc22f42..0d5732b7 100644 --- a/managers/paranet-operations-manager.js +++ b/managers/paranet-operations-manager.js @@ -1,5 +1,5 @@ -const { resolveUAL } = require('../services/utilities.js'); const { ethers } = require('ethers'); +const { resolveUAL } = require('../services/utilities.js'); const { INCENTIVE_TYPE, } = require('../constants.js'); @@ -111,9 +111,9 @@ class ParanetOperationsManager { paranetUAL, incentivesPoolContractAddress: neuroIncentivesPoolAddress }; - } else { - throw Error(`Unsupported incentive type: ${incentiveType}.`) } + + throw Error(`Unsupported incentive type: ${incentiveType}.`); } /** @@ -181,7 +181,7 @@ class ParanetOperationsManager { const { contract, tokenId } = resolveUAL(paranetUAL); const processedServicesArray = []; - for(let serviceUAL of paranetServiceUALs) { + for(const serviceUAL of paranetServiceUALs) { const { contract: serviceContract, tokenId: serviceTokenId } = resolveUAL(serviceUAL) processedServicesArray.push([ serviceContract, serviceTokenId ]); } @@ -449,6 +449,10 @@ class ParanetOperationsManager { status: receipt.status, }; } + + return { + status: 'No updated knowledge assets.' + }; } /** @@ -461,6 +465,7 @@ class ParanetOperationsManager { * const isMiner = await dkg.paranet.isKnowledgeMiner('paranetUAL123', { roleAddress: '0xMinerAddress' }); */ async isKnowledgeMiner(paranetUAL, options = {}) { + // eslint-disable-next-line prefer-const let { blockchain, roleAddress } = this.inputService.getParanetRoleCheckArguments(options); if (roleAddress == null) { roleAddress = blockchain.publicKey; @@ -491,6 +496,7 @@ class ParanetOperationsManager { * const isOperator = await dkg.paranet.isParanetOperator('paranetUAL123', { roleAddress: '0xOperatorAddress' }); */ async isParanetOperator(paranetUAL, options = {}) { + // eslint-disable-next-line prefer-const let { blockchain, roleAddress } = this.inputService.getParanetRoleCheckArguments(options); if (roleAddress == null) { roleAddress = blockchain.publicKey; @@ -521,6 +527,7 @@ class ParanetOperationsManager { * const isVoter = await dkg.paranet.isProposalVoter('paranetUAL123', { roleAddress: '0xVoterAddress' }); */ async isProposalVoter(paranetUAL, options = {}) { + // eslint-disable-next-line prefer-const let { blockchain, roleAddress } = this.inputService.getParanetRoleCheckArguments(options); if (roleAddress == null) { roleAddress = blockchain.publicKey; diff --git a/services/blockchain-service/blockchain-service-base.js b/services/blockchain-service/blockchain-service-base.js index 38021651..18291036 100644 --- a/services/blockchain-service/blockchain-service-base.js +++ b/services/blockchain-service/blockchain-service-base.js @@ -633,11 +633,16 @@ class BlockchainServiceBase { async setIncentivesPool(contractAddress, blockchain){ const web3Instance = await this.getWeb3Instance(blockchain); - if (this[blockchain.name].contractAddresses[blockchain.hubContract]['ParanetNeuroIncentivesPool'] != contractAddress) { + // eslint-disable-next-line dot-notation + if (this[blockchain.name].contractAddresses[blockchain.hubContract]['ParanetNeuroIncentivesPool'] !== contractAddress) { + // eslint-disable-next-line dot-notation this[blockchain.name].contractAddresses[blockchain.hubContract]['ParanetNeuroIncentivesPool'] = contractAddress; + // eslint-disable-next-line dot-notation this[blockchain.name].contracts[blockchain.hubContract]['ParanetNeuroIncentivesPool'] = await new web3Instance.eth.Contract( + // eslint-disable-next-line dot-notation this.abis['ParanetNeuroIncentivesPool'], + // eslint-disable-next-line dot-notation this[blockchain.name].contractAddresses[blockchain.hubContract]['ParanetNeuroIncentivesPool'], ); } diff --git a/services/validation-service.js b/services/validation-service.js index 59bb1ce0..c48862ba 100644 --- a/services/validation-service.js +++ b/services/validation-service.js @@ -261,7 +261,7 @@ class ValidationService { this.validateUAL(paranetUAL); this.validateBlockchain(blockchain); - for(let UAL of paranetServiceUALs){ + for(const UAL of paranetServiceUALs){ this.validateUAL(UAL); } } @@ -549,8 +549,8 @@ class ValidationService { } validateParanetServiceAddresses(paranetServiceAddresses) { - if(paranetServiceAddresses.length != 0) { - for(let address of paranetServiceAddresses) { + if(paranetServiceAddresses.length !== 0) { + for(const address of paranetServiceAddresses) { this.validateAddress(address); } }