mirror of https://github.com/embarklabs/embark.git
move fuzer & gasEstimator to profiler module
This commit is contained in:
parent
d40ae2f374
commit
20f782607c
|
@ -189,7 +189,6 @@ class Engine {
|
||||||
this.registerModule('solidity', {ipc: this.ipc, useDashboard: this.useDashboard});
|
this.registerModule('solidity', {ipc: this.ipc, useDashboard: this.useDashboard});
|
||||||
this.registerModule('vyper');
|
this.registerModule('vyper');
|
||||||
this.registerModule('profiler');
|
this.registerModule('profiler');
|
||||||
this.registerModule('fuzzer');
|
|
||||||
this.registerModule('deploytracker');
|
this.registerModule('deploytracker');
|
||||||
this.registerModule('specialconfigs');
|
this.registerModule('specialconfigs');
|
||||||
this.registerModule('console_listener', {ipc: this.ipc});
|
this.registerModule('console_listener', {ipc: this.ipc});
|
||||||
|
|
|
@ -7,8 +7,6 @@ class ContractFuzzer {
|
||||||
this.embark = embark;
|
this.embark = embark;
|
||||||
this.logger = embark.logger;
|
this.logger = embark.logger;
|
||||||
this.events = embark.events;
|
this.events = embark.events;
|
||||||
|
|
||||||
this.registerConsoleCommand();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// main function to call, takes in iteration number and a contract and returns a map object
|
// main function to call, takes in iteration number and a contract and returns a map object
|
||||||
|
@ -90,24 +88,6 @@ class ContractFuzzer {
|
||||||
generateRandomAddress() {
|
generateRandomAddress() {
|
||||||
return utils.randomHex(20);
|
return utils.randomHex(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
registerConsoleCommand() {
|
|
||||||
const self = this;
|
|
||||||
self.embark.registerConsoleCommand((cmd, _options) => {
|
|
||||||
let splitCmd = cmd.split(' ');
|
|
||||||
let cmdName = splitCmd[0];
|
|
||||||
let contractName = splitCmd[1];
|
|
||||||
let iterations = splitCmd[2] === undefined ? 1 : splitCmd[2];
|
|
||||||
if (cmdName === 'fuzz') {
|
|
||||||
self.events.request('contracts:contract', contractName, (contract) => {
|
|
||||||
self.logger.info("-- fuzzed vals for " + contractName);
|
|
||||||
this.generateFuzz(iterations, contract);
|
|
||||||
});
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ContractFuzzer;
|
module.exports = ContractFuzzer;
|
|
@ -1,7 +1,7 @@
|
||||||
/*global web3*/
|
/*global web3*/
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
const _ = require('underscore');
|
const _ = require('underscore');
|
||||||
const ContractFuzzer = require('../fuzzer');
|
const ContractFuzzer = require('./fuzzer.js');
|
||||||
|
|
||||||
class GasEstimator {
|
class GasEstimator {
|
||||||
constructor(embark) {
|
constructor(embark) {
|
|
@ -1,5 +1,5 @@
|
||||||
const asciiTable = require('ascii-table');
|
const asciiTable = require('ascii-table');
|
||||||
const GasEstimator = require('../gasEstimator');
|
const GasEstimator = require('./gasEstimator.js');
|
||||||
|
|
||||||
class Profiler {
|
class Profiler {
|
||||||
constructor(embark) {
|
constructor(embark) {
|
||||||
|
|
Loading…
Reference in New Issue