Skip to content

Commit

Permalink
Merge pull request #138 from OriginTrail/feature/paranets
Browse files Browse the repository at this point in the history
Resolve lint errors
  • Loading branch information
NZT48 authored Jun 21, 2024
2 parents 10c60b5 + 1dae747 commit aa79da9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ module.exports = {
ASSERTION_STATES,
CONTENT_TYPES,
GET_OUTPUT_FORMATS,
INCENTIVE_TYPE,
ASSET_STATES,
STORE_TYPES,
GRAPH_LOCATIONS,
Expand Down
15 changes: 11 additions & 4 deletions managers/paranet-operations-manager.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -111,9 +111,9 @@ class ParanetOperationsManager {
paranetUAL,
incentivesPoolContractAddress: neuroIncentivesPoolAddress
};
} else {
throw Error(`Unsupported incentive type: ${incentiveType}.`)
}

throw Error(`Unsupported incentive type: ${incentiveType}.`);
}

/**
Expand Down Expand Up @@ -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 ]);
}
Expand Down Expand Up @@ -449,6 +449,10 @@ class ParanetOperationsManager {
status: receipt.status,
};
}

return {
status: 'No updated knowledge assets.'
};
}

/**
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion services/blockchain-service/blockchain-service-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
);
}
Expand Down
6 changes: 3 additions & 3 deletions services/validation-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit aa79da9

Please sign in to comment.