formatting fixes

Signed-off-by: VoR0220 <catalanor0220@gmail.com>

one more

Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
VoR0220 2018-06-05 14:39:32 -05:00
parent 773f5a7921
commit 95a06e0bf9

View File

@ -5,7 +5,6 @@ const _ = require('underscore');
// generates random inputs based on the inputs of an ABI
class ContractFuzzer {
constructor(embark) {
//this.abi = abi;
this.embark = embark;
this.logger = embark.logger;
this.events = embark.events;
@ -18,12 +17,13 @@ class ContractFuzzer {
generateFuzz(iterations, contract) {
const self = this;
let fuzzMap = {};
for (let i = 0; i < iterations; i++) contract.abiDefinition.filter((x) => x.inputs && x.inputs.length != 0).forEach((abiMethod) => {
for (let i = 0; i < iterations; i++) {
contract.abiDefinition.filter((x) => x.inputs && x.inputs.length != 0).forEach((abiMethod) => {
let name = abiMethod.type === "constructor" ? "constructor" : abiMethod.name;
let inputTypes = abiMethod.inputs.map(input => input.type);
let fuzzedInputs = _.map(inputTypes, this.getTypeFuzz.bind(this));
fuzzMap[name] = fuzzedInputs;
fuzzMap[name] = inputTypes.map(input => this.getTypeFuzz.bind(this));
});
}
for (let key in fuzzMap) self.logger.info(key + ":" + fuzzMap[key]);
return fuzzMap;
}