fix indentation

This commit is contained in:
Jonathan Rainville 2018-06-21 11:41:44 -04:00 committed by Iuri Matias
parent 86ba7e3803
commit deb54e535c
1 changed files with 76 additions and 76 deletions

View File

@ -16,20 +16,20 @@ class ConsoleListener {
}); });
} }
_updateContractList(){ _updateContractList() {
this.events.request("contracts:list", (_err, contractsList) => { this.events.request("contracts:list", (_err, contractsList) => {
if(_err) { if (_err) {
this.logger.error(__("no contracts found")); this.logger.error(__("no contracts found"));
return; return;
} }
contractsList.forEach(contract => { contractsList.forEach(contract => {
if(!contract.deployedAddress) return; if (!contract.deployedAddress) return;
let address = contract.deployedAddress.toLowerCase(); let address = contract.deployedAddress.toLowerCase();
if(!this.addressToContract[address]){ if (!this.addressToContract[address]) {
let funcSignatures = {}; let funcSignatures = {};
contract.abiDefinition contract.abiDefinition
.filter(func => func.type == "function") .filter(func => func.type === "function")
.map(func => { .map(func => {
const name = func.name + const name = func.name +
'(' + '(' +
@ -51,17 +51,17 @@ class ConsoleListener {
}); });
} }
_listenForLogRequests(){ _listenForLogRequests() {
if(this.ipc.ipcRole !== 'server') return; if (this.ipc.ipcRole !== 'server') return;
this.ipc.on('log', (request) => { this.ipc.on('log', (request) => {
if(request.type == 'contract-log'){ if (request.type === 'contract-log') {
if(!this.contractsDeployed) return; if (!this.contractsDeployed) return;
let {address, data, transactionHash, blockNumber, gasUsed, status} = request; let {address, data, transactionHash, blockNumber, gasUsed, status} = request;
if(!this.addressToContract[address]){ if (!this.addressToContract[address]) {
this._updateContractList(); this._updateContractList();
} }
if(!this.addressToContract[address]) return; if (!this.addressToContract[address]) return;
const name = this.addressToContract[address].name; const name = this.addressToContract[address].name;
@ -70,9 +70,9 @@ class ConsoleListener {
const decodedParameters = utils.decodeParams(func.abi.inputs, data.substring(10)); const decodedParameters = utils.decodeParams(func.abi.inputs, data.substring(10));
let paramString = ""; let paramString = "";
if(func.abi.inputs){ if (func.abi.inputs) {
func.abi.inputs.forEach((input) => { func.abi.inputs.forEach((input) => {
let quote = input.type.indexOf("int") == -1 ? '"' : ''; let quote = input.type.indexOf("int") === -1 ? '"' : '';
paramString += quote + decodedParameters[input.name] + quote + ", "; paramString += quote + decodedParameters[input.name] + quote + ", ";
}); });
paramString = paramString.substring(0, paramString.length - 2); paramString = paramString.substring(0, paramString.length - 2);