Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Lazovic committed Jul 9, 2018
1 parent b293a83 commit 33c01f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions contracts/PatriciaTree/PatriciaTreeProofs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 3 additions & 5 deletions contracts/ReputationMiningCycle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -569,17 +569,15 @@ 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);
require(expectedSkillId == skillId);
}
}

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.
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion packages/reputation-miner/patricia.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 33c01f3

Please sign in to comment.