UDapp: indent after latest change

pull/1/head
Alex Beregszaszi 9 years ago
parent 00f41bf248
commit 37e94196d9
  1. 66
      src/universal-dapp.js

@ -448,35 +448,35 @@ UniversalDApp.prototype.getCallButton = function (args) {
} }
var decodeResponse = function (response) { var decodeResponse = function (response) {
// Only decode if there supposed to be fields // Only decode if there supposed to be fields
if (args.abi.outputs.length > 0) { if (args.abi.outputs.length > 0) {
try { try {
var i; var i;
var outputTypes = []; var outputTypes = [];
for (i = 0; i < args.abi.outputs.length; i++) { for (i = 0; i < args.abi.outputs.length; i++) {
outputTypes.push(args.abi.outputs[i].type); outputTypes.push(args.abi.outputs[i].type);
} }
// decode data // decode data
var decodedObj = ethJSABI.rawDecode(outputTypes, response); var decodedObj = ethJSABI.rawDecode(outputTypes, response);
// format decoded data // format decoded data
decodedObj = ethJSABI.stringify(outputTypes, decodedObj); decodedObj = ethJSABI.stringify(outputTypes, decodedObj);
for (i = 0; i < outputTypes.length; i++) { for (i = 0; i < outputTypes.length; i++) {
var name = args.abi.outputs[i].name; var name = args.abi.outputs[i].name;
if (name.length > 0) { if (name.length > 0) {
decodedObj[i] = outputTypes[i] + ' ' + name + ': ' + decodedObj[i]; decodedObj[i] = outputTypes[i] + ' ' + name + ': ' + decodedObj[i];
} else { } else {
decodedObj[i] = outputTypes[i] + ': ' + decodedObj[i]; decodedObj[i] = outputTypes[i] + ': ' + decodedObj[i];
}
} }
return getDecodedOutput(decodedObj);
} catch (e) {
return getDecodedOutput('Failed to decode output: ' + e);
} }
return getDecodedOutput(decodedObj);
} catch (e) {
return getDecodedOutput('Failed to decode output: ' + e);
} }
}
}; };
var decoded; var decoded;
@ -497,18 +497,18 @@ UniversalDApp.prototype.getCallButton = function (args) {
clearOutput($result); clearOutput($result);
$result.append(getReturnOutput(outputObj)).append(getGasUsedOutput(result, result.vm)); $result.append(getReturnOutput(outputObj)).append(getGasUsedOutput(result, result.vm));
decoded = decodeResponse(result.vm.return); decoded = decodeResponse(result.vm.return);
if (decoded) { if (decoded) {
$result.append(decoded); $result.append(decoded);
} }
} else if (args.abi.constant && !isConstructor) { } else if (args.abi.constant && !isConstructor) {
clearOutput($result); clearOutput($result);
$result.append(getReturnOutput(result)).append(getGasUsedOutput({})); $result.append(getReturnOutput(result)).append(getGasUsedOutput({}));
decoded = decodeResponse(ethJSUtil.toBuffer(result)); decoded = decodeResponse(ethJSUtil.toBuffer(result));
if (decoded) { if (decoded) {
$result.append(decoded); $result.append(decoded);
} }
} else { } else {
clearOutput($result); clearOutput($result);
$result.append(getReturnOutput(result)).append(getGasUsedOutput(result)); $result.append(getReturnOutput(result)).append(getGasUsedOutput(result));

Loading…
Cancel
Save