From 37e94196d96ecaa4fb822130fe97b0ba7fd17d1a Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 9 Jun 2016 01:13:59 +0100 Subject: [PATCH] UDapp: indent after latest change --- src/universal-dapp.js | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 495acee44b..5b3717851b 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -448,35 +448,35 @@ UniversalDApp.prototype.getCallButton = function (args) { } var decodeResponse = function (response) { - // Only decode if there supposed to be fields - if (args.abi.outputs.length > 0) { - try { - var i; - - var outputTypes = []; - for (i = 0; i < args.abi.outputs.length; i++) { - outputTypes.push(args.abi.outputs[i].type); - } + // Only decode if there supposed to be fields + if (args.abi.outputs.length > 0) { + try { + var i; + + var outputTypes = []; + for (i = 0; i < args.abi.outputs.length; i++) { + outputTypes.push(args.abi.outputs[i].type); + } - // decode data - var decodedObj = ethJSABI.rawDecode(outputTypes, response); - - // format decoded data - decodedObj = ethJSABI.stringify(outputTypes, decodedObj); - for (i = 0; i < outputTypes.length; i++) { - var name = args.abi.outputs[i].name; - if (name.length > 0) { - decodedObj[i] = outputTypes[i] + ' ' + name + ': ' + decodedObj[i]; - } else { - decodedObj[i] = outputTypes[i] + ': ' + decodedObj[i]; - } + // decode data + var decodedObj = ethJSABI.rawDecode(outputTypes, response); + + // format decoded data + decodedObj = ethJSABI.stringify(outputTypes, decodedObj); + for (i = 0; i < outputTypes.length; i++) { + var name = args.abi.outputs[i].name; + if (name.length > 0) { + decodedObj[i] = outputTypes[i] + ' ' + name + ': ' + decodedObj[i]; + } else { + 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; @@ -497,18 +497,18 @@ UniversalDApp.prototype.getCallButton = function (args) { clearOutput($result); $result.append(getReturnOutput(outputObj)).append(getGasUsedOutput(result, result.vm)); - decoded = decodeResponse(result.vm.return); - if (decoded) { - $result.append(decoded); - } + decoded = decodeResponse(result.vm.return); + if (decoded) { + $result.append(decoded); + } } else if (args.abi.constant && !isConstructor) { clearOutput($result); $result.append(getReturnOutput(result)).append(getGasUsedOutput({})); - decoded = decodeResponse(ethJSUtil.toBuffer(result)); - if (decoded) { - $result.append(decoded); - } + decoded = decodeResponse(ethJSUtil.toBuffer(result)); + if (decoded) { + $result.append(decoded); + } } else { clearOutput($result); $result.append(getReturnOutput(result)).append(getGasUsedOutput(result));