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
|
// generates random inputs based on the inputs of an ABI
|
||||||
class ContractFuzzer {
|
class ContractFuzzer {
|
||||||
constructor(embark) {
|
constructor(embark) {
|
||||||
//this.abi = abi;
|
|
||||||
this.embark = embark;
|
this.embark = embark;
|
||||||
this.logger = embark.logger;
|
this.logger = embark.logger;
|
||||||
this.events = embark.events;
|
this.events = embark.events;
|
||||||
@ -18,12 +17,13 @@ class ContractFuzzer {
|
|||||||
generateFuzz(iterations, contract) {
|
generateFuzz(iterations, contract) {
|
||||||
const self = this;
|
const self = this;
|
||||||
let fuzzMap = {};
|
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 name = abiMethod.type === "constructor" ? "constructor" : abiMethod.name;
|
||||||
let inputTypes = abiMethod.inputs.map(input => input.type);
|
let inputTypes = abiMethod.inputs.map(input => input.type);
|
||||||
let fuzzedInputs = _.map(inputTypes, this.getTypeFuzz.bind(this));
|
fuzzMap[name] = inputTypes.map(input => this.getTypeFuzz.bind(this));
|
||||||
fuzzMap[name] = fuzzedInputs;
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
for (let key in fuzzMap) self.logger.info(key + ":" + fuzzMap[key]);
|
for (let key in fuzzMap) self.logger.info(key + ":" + fuzzMap[key]);
|
||||||
return fuzzMap;
|
return fuzzMap;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user