mirror of https://github.com/embarklabs/embark.git
Removing unused variables
This commit is contained in:
parent
0f853ba841
commit
09c11662aa
|
@ -14,7 +14,7 @@ exports.serve = function(ipc, host, port, ws){
|
|||
ws: ws
|
||||
});
|
||||
|
||||
proxy.on('error', function (err, req, res) {
|
||||
proxy.on('error', function () {
|
||||
proxy.close();
|
||||
});
|
||||
|
||||
|
@ -37,7 +37,7 @@ exports.serve = function(ipc, host, port, ws){
|
|||
ipc.request('log', commList[receipts[jsonO.id]]);
|
||||
} else {
|
||||
ipc.connecting = true;
|
||||
ipc.connect((err) => {
|
||||
ipc.connect(() => {
|
||||
ipc.connecting = false;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -41,36 +41,40 @@ class ConsoleListener {
|
|||
}
|
||||
|
||||
listenForLogRequests(){
|
||||
this.ipc.on('log', (request) => {
|
||||
if(request.type == 'contract-log'){
|
||||
try {
|
||||
this.ipc.on('log', (request) => {
|
||||
if(request.type == 'contract-log'){
|
||||
|
||||
let {address, data, transactionHash, blockNumber, gasUsed, status} = request;
|
||||
if(!this.addressToContract[address]){
|
||||
this._updateContractList();
|
||||
let {address, data, transactionHash, blockNumber, gasUsed, status} = request;
|
||||
if(!this.addressToContract[address]){
|
||||
this._updateContractList();
|
||||
}
|
||||
|
||||
let name = this.addressToContract[address].name;
|
||||
let func = this.addressToContract[address].functions[data.substring(0, 10)];
|
||||
let functionName = func.functionName;
|
||||
|
||||
let decodedParameters = utils.decodeParams(func.abi.inputs, data.substring(10));
|
||||
let paramString = "";
|
||||
if(func.abi.inputs){
|
||||
func.abi.inputs.forEach((input) => {
|
||||
let quote = input.type.indexOf("int") == -1 ? '"' : '';
|
||||
paramString += quote + decodedParameters[input.name] + quote + ", ";
|
||||
});
|
||||
paramString = paramString.substring(0, paramString.length - 2);
|
||||
}
|
||||
|
||||
gasUsed = utils.hexToNumber(gasUsed);
|
||||
blockNumber = utils.hexToNumber(blockNumber);
|
||||
|
||||
this.logger.debug(`${name}.${functionName}(${paramString}) : ${transactionHash} | gas:${gasUsed} | blk:${blockNumber} | status:${status}`);
|
||||
} else {
|
||||
this.logger.debug(request);
|
||||
}
|
||||
|
||||
let name = this.addressToContract[address].name;
|
||||
let func = this.addressToContract[address].functions[data.substring(0, 10)];
|
||||
let functionName = func.functionName;
|
||||
|
||||
let decodedParameters = utils.decodeParams(func.abi.inputs, data.substring(10));
|
||||
let paramString = "";
|
||||
if(func.abi.inputs){
|
||||
func.abi.inputs.forEach((input) => {
|
||||
let quote = input.type.indexOf("int") == -1 ? '"' : '';
|
||||
paramString += quote + decodedParameters[input.name] + quote + ", ";
|
||||
});
|
||||
paramString = paramString.substring(0, paramString.length - 2);
|
||||
}
|
||||
|
||||
gasUsed = utils.hexToNumber(gasUsed);
|
||||
blockNumber = utils.hexToNumber(blockNumber);
|
||||
|
||||
this.logger.debug(`${name}.${functionName}(${paramString}) : ${transactionHash} | gas:${gasUsed} | blk:${blockNumber} | status:${status}`);
|
||||
} else {
|
||||
this.logger.debug(request);
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch(e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue