mirror of https://github.com/embarklabs/embark.git
Merge branch 'gastimation' of github.com:embark-framework/embark into gastimation
This commit is contained in:
commit
a88513f58d
|
@ -1,7 +1,6 @@
|
||||||
const utils = require('web3-utils');
|
const utils = require('web3-utils');
|
||||||
const _ = require('underscore');
|
const _ = require('underscore');
|
||||||
|
|
||||||
|
|
||||||
// generates random inputs based on the inputs of an ABI
|
// generates random inputs based on the inputs of an ABI
|
||||||
class ContractFuzzer {
|
class ContractFuzzer {
|
||||||
constructor(embark) {
|
constructor(embark) {
|
||||||
|
@ -22,11 +21,10 @@ class ContractFuzzer {
|
||||||
let inputTypes = abiMethod.inputs.map(input => input.type);
|
let inputTypes = abiMethod.inputs.map(input => input.type);
|
||||||
fuzzMap[name] = {};
|
fuzzMap[name] = {};
|
||||||
for (let i = 0; i < iterations; i++) {
|
for (let i = 0; i < iterations; i++) {
|
||||||
fuzzMap[name][i] = {};
|
|
||||||
fuzzMap[name][i] = inputTypes.map(input => this.getTypeFuzz(input));
|
fuzzMap[name][i] = inputTypes.map(input => this.getTypeFuzz(input));
|
||||||
}
|
|
||||||
self.logger.info(name);
|
self.logger.info(name);
|
||||||
for (let key in fuzzMap[name]) self.logger.info("iteration: " + key + "\n" + fuzzMap[name][key]);
|
self.logger.info("iteration: " + i + "\n" + fuzzMap[name][i]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
self.logger.info('\n');
|
self.logger.info('\n');
|
||||||
return fuzzMap;
|
return fuzzMap;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
/*global web3*/
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
const _ = require('underscore');
|
const _ = require('underscore');
|
||||||
const ContractFuzzer = require('../fuzzer');
|
const ContractFuzzer = require('../fuzzer');
|
||||||
|
|
||||||
/*global web3*/
|
|
||||||
|
|
||||||
class GasEstimator {
|
class GasEstimator {
|
||||||
constructor(embark) {
|
constructor(embark) {
|
||||||
this.embark = embark;
|
this.embark = embark;
|
||||||
|
|
Loading…
Reference in New Issue