Added events to graph and fixed problems in IDE

This commit is contained in:
Richard Ramos 2018-03-23 08:28:42 -04:00
parent 403f2daee2
commit 7dcae55b8b
2 changed files with 13 additions and 13 deletions

View File

@ -33,15 +33,22 @@ class GraphGenerator {
for(let i = 0; i < this.engine.contractsManager.contracts[contract].abiDefinition.length; i++){ for(let i = 0; i < this.engine.contractsManager.contracts[contract].abiDefinition.length; i++){
switch(this.engine.contractsManager.contracts[contract].abiDefinition[i].type){ switch(this.engine.contractsManager.contracts[contract].abiDefinition[i].type){
case 'fallback': case 'fallback':
contractLabel += "«fallback»()" + '\\l'; contractLabel += "«fallback»()\\l";
break; break;
case 'constructor': case 'constructor':
contractLabel += "«constructor»("; contractLabel += "«constructor»(";
for(let j = 0; j < this.engine.contractsManager.contracts[contract].abiDefinition[i].inputs.length; j++){ for(let j = 0; j < this.engine.contractsManager.contracts[contract].abiDefinition[i].inputs.length; j++){
contractLabel += (j == 0 ? "" : ", ") + this.engine.contractsManager.contracts[contract].abiDefinition[i].inputs[j].type; contractLabel += (j == 0 ? "" : ", ") + this.engine.contractsManager.contracts[contract].abiDefinition[i].inputs[j].type;
} }
contractLabel += ")\\l"; contractLabel += ")\\l";
break; break;
case 'event':
contractLabel += "«event»" + this.engine.contractsManager.contracts[contract].abiDefinition[i].name + "(";
for(let j = 0; j < this.engine.contractsManager.contracts[contract].abiDefinition[i].inputs.length; j++){
contractLabel += (j == 0 ? "" : ", ") + this.engine.contractsManager.contracts[contract].abiDefinition[i].inputs[j].type;
}
contractLabel += ")\\l";
break;
default: break; default: break;
} }
} }
@ -54,23 +61,21 @@ class GraphGenerator {
} }
contractString += `${id}[label = "{${contractLabel}}"]` contractString += `${id}[label = "{${contractLabel}}"]\n`;
contractString += "\n";
} }
for (let c in this.engine.contractsManager.contractDependencies){ for (let c in this.engine.contractsManager.contractDependencies){
let contractDependencies = Array.from(new Set(this.engine.contractsManager.contractDependencies[c])); let contractDependencies = Array.from(new Set(this.engine.contractsManager.contractDependencies[c]));
contractDependencies.forEach(function(d){ contractDependencies.forEach(function(d){
if(idMapping[c] !== undefined && idMapping[d] !== undefined){ if(idMapping[c] !== undefined && idMapping[d] !== undefined){
relationshipString += `${idMapping[d]}->${idMapping[c]}[constraint=true, arrowtail=diamond]` relationshipString += `${idMapping[d]}->${idMapping[c]}[constraint=true, arrowtail=diamond]\n`;
relationshipString += "\n";
} }
}); });
} }
for (let c in contractInheritance){ for (let c in contractInheritance){
relationshipString += `${idMapping[contractInheritance[c]]}->${idMapping[c]}` relationshipString += `${idMapping[contractInheritance[c]]}->${idMapping[c]}\n`;
relationshipString += "\n";
} }

View File

@ -186,11 +186,6 @@ class Embark {
} }
graph(options) { graph(options) {
let self = this;
options.onlyCompile = true; options.onlyCompile = true;
let engine = new Engine({ let engine = new Engine({