clean up junk and fix logger formatting
Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
parent
335670f2ca
commit
e0470b8ef4
|
@ -20,34 +20,18 @@ class ContractFuzzer {
|
||||||
contract.abiDefinition.filter((x) => x.inputs && x.inputs.length != 0).forEach((abiMethod) => {
|
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);
|
||||||
self.logger.debug("input method:", name);
|
|
||||||
fuzzMap[name] = {};
|
fuzzMap[name] = {};
|
||||||
for (let i = 0; i < iterations; i++) {
|
for (let i = 0; i < iterations; i++) {
|
||||||
fuzzMap[name][i] = {};
|
fuzzMap[name][i] = {};
|
||||||
self.logger.debug("iteration:", i);
|
|
||||||
fuzzMap[name][i] = inputTypes.map(input => this.getTypeFuzz(input));
|
fuzzMap[name][i] = inputTypes.map(input => this.getTypeFuzz(input));
|
||||||
}
|
}
|
||||||
for (let key in fuzzMap[name]) self.logger.info(name + ":" + fuzzMap[name][key]);
|
self.logger.info(name);
|
||||||
|
for (let key in fuzzMap[name]) self.logger.info("iteration: " + key + "\n" + fuzzMap[name][key]);
|
||||||
});
|
});
|
||||||
self.logger.info('\n');
|
self.logger.info('\n');
|
||||||
return fuzzMap;
|
return fuzzMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*for (let i = 0; i < iterations; i++) {
|
|
||||||
fuzzMap[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);
|
|
||||||
self.logger.debug("input method:", name);
|
|
||||||
self.logger.debug("iteration:", i);
|
|
||||||
fuzzMap[i][name] = inputTypes.map(input => this.getTypeFuzz(input));
|
|
||||||
});
|
|
||||||
self.logger.info('\n');
|
|
||||||
for (let key in fuzzMap[i]) self.logger.info(key + ":" + fuzzMap[i][key]);
|
|
||||||
});
|
|
||||||
return fuzzMap;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
getTypeFuzz(typeString) {
|
getTypeFuzz(typeString) {
|
||||||
const self = this;
|
const self = this;
|
||||||
// Group 0: uint256[3]
|
// Group 0: uint256[3]
|
||||||
|
|
Loading…
Reference in New Issue