diff --git a/.eslintrc b/.eslintrc index b005005384..6e708cb5f7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,8 @@ "max-len": [2, { "code": 150, "ignoreComments": true }], "prettier/prettier": ["error", {"printWidth": 150}], "flowtype/require-valid-file-annotation": "off", - "import/named": "off" + "import/named": "off", + "no-console": "off" }, "parserOptions": { "ecmaVersion": 2017 diff --git a/.soliumrc.json b/.soliumrc.json index 329b3bb896..75289ad0e2 100644 --- a/.soliumrc.json +++ b/.soliumrc.json @@ -9,6 +9,7 @@ "quotes": ["error", "double"], "security/no-inline-assembly": 0, "security/no-call-value": 0, - "security/no-block-members": 0 + "security/no-block-members": 0, + "no-experimental": 0 } } diff --git a/contracts/PatriciaTree/IPatriciaTree.sol b/contracts/PatriciaTree/IPatriciaTree.sol index b53314422d..78c53581be 100644 --- a/contracts/PatriciaTree/IPatriciaTree.sol +++ b/contracts/PatriciaTree/IPatriciaTree.sol @@ -30,7 +30,7 @@ contract IPatriciaTree { /// @notice Calculates and returns a root hash for the `key`, `value`, `branchMask` and `siblings` /// @return The calculated hash - function getImpliedRoot(bytes key, bytes value, uint branchMask, bytes32[] siblings) public view returns (bytes32); + function getImpliedRoot(bytes key, bytes value, uint branchMask, bytes32[] siblings) public pure returns (bytes32); /// @notice Insert the `key`/`value`in the appropriate place in the tree function insert(bytes key, bytes value) public; diff --git a/contracts/PatriciaTree/PatriciaTreeProofs.sol b/contracts/PatriciaTree/PatriciaTreeProofs.sol index f48d98248c..74f242370b 100644 --- a/contracts/PatriciaTree/PatriciaTreeProofs.sol +++ b/contracts/PatriciaTree/PatriciaTreeProofs.sol @@ -14,8 +14,7 @@ contract PatriciaTreeProofs { using Data for Data.Label; function getImpliedRoot(bytes key, bytes value, uint branchMask, bytes32[] siblings) public // solium-disable-line security/no-assign-params - view - returns (bytes32) + pure returns (bytes32) { Data.Label memory k = Data.Label(keccak256(key), 256); Data.Edge memory e; diff --git a/contracts/ReputationMiningCycle.sol b/contracts/ReputationMiningCycle.sol index 53f721cd59..f92115623d 100644 --- a/contracts/ReputationMiningCycle.sol +++ b/contracts/ReputationMiningCycle.sol @@ -569,7 +569,7 @@ contract ReputationMiningCycle is PatriciaTreeProofs, DSMath { // Not sure what the alternative would be anyway. } bool decayCalculation = false; - if (decayCalculation) { + if (decayCalculation) { // solium-disable-line no-empty-blocks, whitespace } else { require(expectedAddress == userAddress); require(logEntry.colony == colonyAddress); @@ -577,9 +577,7 @@ contract ReputationMiningCycle is PatriciaTreeProofs, DSMath { } } - function getExpectedSkillIdAndAddress(ReputationLogEntry storage logEntry, uint256 updateNumber) - internal - view + function getExpectedSkillIdAndAddress(ReputationLogEntry storage logEntry, uint256 updateNumber) internal view returns (uint256 expectedSkillId, address expectedAddress) { // Work out the expected userAddress and skillId for this updateNumber in this logEntry. @@ -597,7 +595,7 @@ contract ReputationMiningCycle is PatriciaTreeProofs, DSMath { uint nParents; (nParents, ) = IColonyNetwork(colonyNetworkAddress).getSkill(logEntry.skillId); uint nChildUpdates; - if (logEntry.amount >= 0) { + if (logEntry.amount >= 0) { // solium-disable-line no-empty-blocks, whitespace // Then we have no child updates to consider } else { nChildUpdates = logEntry.nUpdates/2 - 1 - nParents; diff --git a/packages/reputation-miner/patricia.js b/packages/reputation-miner/patricia.js index 8eeeef5623..c4789ab2d9 100644 --- a/packages/reputation-miner/patricia.js +++ b/packages/reputation-miner/patricia.js @@ -102,7 +102,7 @@ function removePrefix(label, prefix) { // ////// // Patricia Tree // ////////////////// -exports.PatriciaTree = function() { +exports.PatriciaTree = function PatriciaTree() { // Label: { data, length } (data is the path, length says how many bits are used) // Edge: { nodeHash, label } // Node: [leftEdge, rightEdge] (no actual node) @@ -150,6 +150,7 @@ exports.PatriciaTree = function() { let length = 0; let branchMask = new BN(0, 16); + // eslint-disable-next-line no-constant-condition while (true) { const [prefix, suffix] = splitCommonPrefix(label, edge.label);