mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
formatting fixes
Signed-off-by: VoR0220 <catalanor0220@gmail.com> one more Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
parent
773f5a7921
commit
95a06e0bf9
@ -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) => {
|
||||
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;
|
||||
});
|
||||
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);
|
||||
fuzzMap[name] = inputTypes.map(input => this.getTypeFuzz.bind(this));
|
||||
});
|
||||
}
|
||||
for (let key in fuzzMap) self.logger.info(key + ":" + fuzzMap[key]);
|
||||
return fuzzMap;
|
||||
}
|
||||
@ -102,8 +102,8 @@ class ContractFuzzer {
|
||||
this.generateFuzz(iterations, contract);
|
||||
});
|
||||
return "";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user