fix linting

This commit is contained in:
Jonathan Rainville 2018-09-06 09:57:16 -04:00
parent fbe27ece2f
commit e9cc6ca9e8
8 changed files with 10 additions and 26 deletions

View File

@ -1,6 +1,6 @@
import PropTypes from "prop-types";
import React, {Component} from 'react';
import {Grid, Card, Form, Tabs, Tab, TabbedHeader, TabbedContainer} from 'tabler-react';
import {Grid, Card, Form, Tab, TabbedHeader, TabbedContainer} from 'tabler-react';
import Logs from "./Logs";
import Convert from 'ansi-to-html';

View File

@ -44,18 +44,10 @@ export function getProcesses(state) {
return state.entities.processes;
}
export function getProcess(state, name) {
return state.entities.processes.find((process) => process.name === name);
}
export function getProcessLogs(state) {
return state.entities.processLogs;
}
export function getProcessLogsByProcess(state, processName) {
return state.entities.processLogs.filter((processLog => processLog.name === processName));
}
export function getContractLogsByContract(state, contractName) {
return state.entities.contractLogs.filter((contractLog => contractLog.name === contractName));
}

View File

@ -1,5 +1,5 @@
process.on('uncaughtException', function(e){
process.send({error: e.stack});
process.on('uncaughtException', function(e) {
process.send({error: e.stack});
});
const constants = require('../../constants');

View File

@ -11,7 +11,7 @@ class ContractSource {
this.lineCount = this.lineLengths.length;
this.lineOffsets = this.lineLengths.reduce((sum, _elt, i) => {
sum[i] = (i == 0) ? 0 : self.lineLengths[i-1] + sum[i-1] + 1;
sum[i] = (i === 0) ? 0 : self.lineLengths[i-1] + sum[i-1] + 1;
return sum;
}, []);
@ -245,7 +245,7 @@ class ContractSource {
trace.structLogs.forEach((step) => {
step = bytecode[step.pc];
if(!step.sourceMap || step.sourceMap == '') return;
if(!step.sourceMap || step.sourceMap === '') return;
var nodes = sourceMapToNodeType[step.sourceMap];
@ -262,7 +262,7 @@ class ContractSource {
recordedLineHit = true;
}
if(node.type != 'b') coverage[node.type][node.id]++;
if(node.type !== 'b') coverage[node.type][node.id]++;
if(!node.parent) return;
@ -282,7 +282,7 @@ class ContractSource {
}
_instructionLength(instruction) {
if(instruction.indexOf('PUSH') == -1) return 1;
if(instruction.indexOf('PUSH') === -1) return 1;
return parseInt(instruction.match(/PUSH(\d+)/m)[1], 10) + 1;
}
}

View File

@ -45,7 +45,7 @@ class CodeCoverage {
async runSolc(receipt) {
let block = await web3.eth.getBlock(receipt.number);
if(block.transactions.length == 0) return;
if(block.transactions.length === 0) return;
let requests = [];
for(let i in block.transactions) {

View File

@ -1,6 +1,6 @@
class SourceMap {
constructor(sourceMapStringOrOffset, length, id) {
if(typeof sourceMapStringOrOffset == 'string') {
if(typeof sourceMapStringOrOffset === 'string') {
let [offset, length, id, ..._rest] = sourceMapStringOrOffset.split(":");
this.offset = parseInt(offset, 10);

View File

@ -129,14 +129,6 @@ class IPFS {
this.embark.addCodeToEmbarkJS(code);
}
addNamesystemProviderToEmbarkJS() {
let code = "";
code += "\n" + fs.readFileSync(utils.joinPath(__dirname, 'embarkjs', 'name.js')).toString();
code += "\nEmbarkJS.Names.registerProvider('ipns', __embarkIPFS);";
this.embark.addCodeToEmbarkJS(code);
}
addObjectToConsole() {
let ipfs = IpfsApi(this.host, this.port);
this.events.emit("runcode:register", "ipfs", ipfs);

View File

@ -50,7 +50,7 @@ class ContractFuzzer {
}
case kind === "bool":
return self.generateRandomBool();
case kind == "uint" || kind == "int":
case kind === "uint" || kind === "int":
return self.generateRandomInt(size || 256);
case kind === "bytes":
return self.generateRandomStaticBytes(size || 32);