From 9e107f8befc8a212e8b3e650e6ee9d8a2b7b128f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 14 Apr 2016 17:06:51 +0200 Subject: [PATCH 1/3] add assembly items --- src/assemblyItemsBrowser.js | 154 ++++++++++++++++++++++++++++++++++++ src/debugger.js | 15 ++-- src/txBrowser.js | 5 +- src/vmTraceBrowser.js | 7 +- src/vmTraceManager.js | 2 +- src/web3Admin.js | 4 +- 6 files changed, 171 insertions(+), 16 deletions(-) create mode 100644 src/assemblyItemsBrowser.js diff --git a/src/assemblyItemsBrowser.js b/src/assemblyItemsBrowser.js new file mode 100644 index 0000000000..e32d08a99f --- /dev/null +++ b/src/assemblyItemsBrowser.js @@ -0,0 +1,154 @@ +var React = require('react'); + +module.exports = React.createClass({ + + getInitialState: function() + { + return { + currentSelected: null, + currentAddress: null + }; + }, + + getDefaultProps: function() + { + return { + vmTrace: null + }; + }, + + render: function() + { + if (!this.props.vmTrace || !this.props.vmTrace.vmtrace || this.props.vmTrace.vmtrace.length === 0) + return null; + this.state.currentAddress = this.props.vmTrace.vmtrace[0].address + this.state.currentSelected = this.props.vmTrace.codesmap[this.state.currentAddress][this.props.vmTrace.vmtrace[0].pc] + return ( +
+
+ + + + +
+
+ +
+
+ ); + }, + + renderAssemblyItems: function() + { + if (this.props.vmTrace) + { + var selectedItem = this.state.currentSelected + return this.props.vmTrace.vmtrace.map(function(item, i) + { + return ; + }); + } + }, + + + stepIntoBack: function () + { + this.moveSelection(-1) + }, + + stepOverBack: function() + { + if (this.isReturnInstruction(this.state.currentSelected - 1)) + this.stepOutBack(); + else + this.moveSelection(-1); + }, + + stepOverForward: function() + { + if (this.isCallInstruction(this.state.currentSelected)) + this.stepOutForward(); + else + this.moveSelection(1); + }, + + stepIntoForward: function() + { + this.moveSelection(1) + }, + + stepOverBack: function() + { + if (this.isReturnInstruction(this.state.currentSelected - 1)) + this.stepOutBack(); + else + this.moveSelection(-1); + }, + + stepOverForward: function() + { + if (this.isCallInstruction(this.state.currentSelected)) + this.stepOutForward(); + else + this.moveSelection(1); + }, + + isCallInstruction: function(index) + { + var state = this.props.vmTrace.vmtrace[index]; + return state.instname === "CALL" || state.instname === "CREATE"; + }, + + isReturnInstruction: function(index) + { + var state = this.props.vmTrace.vmtrace[index]; + return state.instname === "RETURN" + }, + + stepOutBack: function() + { + var i = this.state.currentSelected - 1; + var depth = 0; + while (--i >= 0) { + if (this.isCallInstruction(i)) + if (depth == 0) + break; + else depth--; + else if (this.isReturnInstruction(i)) + depth++; + } + this.selectState(i); + }, + + stepOutForward: function() + { + var i = this.state.currentSelected; + var depth = 0; + while (++i < this.props.vmTrace.vmtrace.length) { + if (this.isReturnInstruction(i)) + if (depth == 0) + break; + else + depth--; + else if (this.isCallInstruction(i)) + depth++; + } + this.selectState(i + 1); + }, + + moveSelection: function(incr) + { + this.selectState(this.state.currentSelected + incr) + }, + + selectState: function(index) + { + var newIndex = this.props.vmTrace.codesmap[this.state.currentAddress][this.props.vmTrace.vmtrace[index].pc] + this.state.currentSelected = index + this.refs.itemsList.value = this.state.currentSelected + if (this.props.vmTrace.vmtrace[index].address && this.state.currentAddress !== this.props.vmTrace.vmtrace[index].address) + this.state.currentAddress = this.props.vmTrace.vmtrace[index].address + }, +}) diff --git a/src/debugger.js b/src/debugger.js index c841e0d251..5acbea0a27 100644 --- a/src/debugger.js +++ b/src/debugger.js @@ -5,20 +5,21 @@ var VmTraceBrowser = require('./vmTraceBrowser'); module.exports = React.createClass({ getInitialState: function() { - return {vmTrace: null} + return {vmTrace: null} }, render: function() { - return (
-

Debugger

- - -
+ return ( +
+

Debugger

+ + +
); }, retrieveVmTrace: function(blockNumber, txNumber) - { + { this.setState({vmTrace: VmTraceManager.retrieveVmTrace(blockNumber, txNumber)}); } }); diff --git a/src/txBrowser.js b/src/txBrowser.js index 8e9f84ea50..949298b7f0 100644 --- a/src/txBrowser.js +++ b/src/txBrowser.js @@ -11,7 +11,7 @@ module.exports = React.createClass({ submit: function() { - this.props.onNewTxRequested(this.state.blockNumber, parseInt(this.state.txNumber), "TmrjdiILLn0="); + this.props.onNewTxRequested(this.state.blockNumber, parseInt(this.state.txNumber)); }, updateBlockN: function(ev) { @@ -22,8 +22,7 @@ module.exports = React.createClass({ this.state.txNumber = ev.target.value; }, - render: function() { - + render: function() { return (

Transaction details

diff --git a/src/vmTraceBrowser.js b/src/vmTraceBrowser.js index c212fb34a9..e3b90f8ffc 100644 --- a/src/vmTraceBrowser.js +++ b/src/vmTraceBrowser.js @@ -1,7 +1,8 @@ var React = require('react'); +var AssemblyItemsBrowser = require('./assemblyItemsBrowser'); module.exports = React.createClass({ - render: function() { - return (
{this.props.vmTrace}
) - } + render: function() { + return ( ) + } }); diff --git a/src/vmTraceManager.js b/src/vmTraceManager.js index ff0ca844b3..938459b3b3 100644 --- a/src/vmTraceManager.js +++ b/src/vmTraceManager.js @@ -1,5 +1,5 @@ module.exports = { retrieveVmTrace: function(blockNumber, txNumber) { - return web3.admin.vmTrace(blockNumber, parseInt(txNumber), "TmrjdiILLn0="); + return web3.admin.vmTrace(blockNumber, parseInt(txNumber)); } } diff --git a/src/web3Admin.js b/src/web3Admin.js index 4ed9baf5d8..92bc3b254d 100644 --- a/src/web3Admin.js +++ b/src/web3Admin.js @@ -58,8 +58,8 @@ module.exports = { new web3._extend.Method({ name: 'vmTrace', call: 'admin_eth_vmTrace', - inputFormatter: [null, null, null], - params: 3 + inputFormatter: [null, null], + params: 2 }), ], properties: From 1164dc67b5bfb5ffedc77bb3e6fcea3df5872444 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 14 Apr 2016 17:14:51 +0200 Subject: [PATCH 2/3] indentation --- src/assemblyItemsBrowser.js | 128 +++++----- src/debugger.js | 32 +-- src/index.js | 4 +- src/txBrowser.js | 10 +- src/vmTraceBrowser.js | 4 +- src/web3Admin.js | 496 ++++++++++++++++++------------------ 6 files changed, 337 insertions(+), 337 deletions(-) diff --git a/src/assemblyItemsBrowser.js b/src/assemblyItemsBrowser.js index e32d08a99f..17c3a36fe8 100644 --- a/src/assemblyItemsBrowser.js +++ b/src/assemblyItemsBrowser.js @@ -2,52 +2,52 @@ var React = require('react'); module.exports = React.createClass({ - getInitialState: function() - { - return { - currentSelected: null, - currentAddress: null - }; - }, + getInitialState: function() + { + return { + currentSelected: null, + currentAddress: null + }; + }, getDefaultProps: function() { - return { - vmTrace: null - }; - }, + return { + vmTrace: null + }; + }, render: function() { - if (!this.props.vmTrace || !this.props.vmTrace.vmtrace || this.props.vmTrace.vmtrace.length === 0) - return null; - this.state.currentAddress = this.props.vmTrace.vmtrace[0].address - this.state.currentSelected = this.props.vmTrace.codesmap[this.state.currentAddress][this.props.vmTrace.vmtrace[0].pc] - return ( -
+ if (!this.props.vmTrace || !this.props.vmTrace.vmtrace || this.props.vmTrace.vmtrace.length === 0) + return null; + this.state.currentAddress = this.props.vmTrace.vmtrace[0].address + this.state.currentSelected = this.props.vmTrace.codesmap[this.state.currentAddress][this.props.vmTrace.vmtrace[0].pc] + return ( +
- - - - + + + +
- +
-
- ); +
+ ); }, renderAssemblyItems: function() { if (this.props.vmTrace) { - var selectedItem = this.state.currentSelected + var selectedItem = this.state.currentSelected return this.props.vmTrace.vmtrace.map(function(item, i) { - return ; + return ; }); } }, @@ -55,7 +55,7 @@ module.exports = React.createClass({ stepIntoBack: function () { - this.moveSelection(-1) + this.moveSelection(-1) }, stepOverBack: function() @@ -116,39 +116,39 @@ module.exports = React.createClass({ if (depth == 0) break; else depth--; - else if (this.isReturnInstruction(i)) - depth++; - } - this.selectState(i); - }, - - stepOutForward: function() - { - var i = this.state.currentSelected; - var depth = 0; - while (++i < this.props.vmTrace.vmtrace.length) { - if (this.isReturnInstruction(i)) - if (depth == 0) - break; - else - depth--; - else if (this.isCallInstruction(i)) - depth++; - } - this.selectState(i + 1); - }, - - moveSelection: function(incr) - { - this.selectState(this.state.currentSelected + incr) - }, + else if (this.isReturnInstruction(i)) + depth++; + } + this.selectState(i); + }, + + stepOutForward: function() + { + var i = this.state.currentSelected; + var depth = 0; + while (++i < this.props.vmTrace.vmtrace.length) { + if (this.isReturnInstruction(i)) + if (depth == 0) + break; + else + depth--; + else if (this.isCallInstruction(i)) + depth++; + } + this.selectState(i + 1); + }, + + moveSelection: function(incr) + { + this.selectState(this.state.currentSelected + incr) + }, - selectState: function(index) - { - var newIndex = this.props.vmTrace.codesmap[this.state.currentAddress][this.props.vmTrace.vmtrace[index].pc] - this.state.currentSelected = index - this.refs.itemsList.value = this.state.currentSelected - if (this.props.vmTrace.vmtrace[index].address && this.state.currentAddress !== this.props.vmTrace.vmtrace[index].address) - this.state.currentAddress = this.props.vmTrace.vmtrace[index].address - }, -}) + selectState: function(index) + { + var newIndex = this.props.vmTrace.codesmap[this.state.currentAddress][this.props.vmTrace.vmtrace[index].pc] + this.state.currentSelected = index + this.refs.itemsList.value = this.state.currentSelected + if (this.props.vmTrace.vmtrace[index].address && this.state.currentAddress !== this.props.vmTrace.vmtrace[index].address) + this.state.currentAddress = this.props.vmTrace.vmtrace[index].address + }, + }) diff --git a/src/debugger.js b/src/debugger.js index 5acbea0a27..879b906e95 100644 --- a/src/debugger.js +++ b/src/debugger.js @@ -4,22 +4,22 @@ var VmTraceManager = require('./vmTraceManager'); var VmTraceBrowser = require('./vmTraceBrowser'); module.exports = React.createClass({ - getInitialState: function() { - return {vmTrace: null} - }, + getInitialState: function() { + return {vmTrace: null} + }, - render: function() { - return ( -
-

Debugger

- - -
- ); - }, + render: function() { + return ( +
+

Debugger

+ + +
+ ); + }, - retrieveVmTrace: function(blockNumber, txNumber) - { - this.setState({vmTrace: VmTraceManager.retrieveVmTrace(blockNumber, txNumber)}); - } + retrieveVmTrace: function(blockNumber, txNumber) + { + this.setState({vmTrace: VmTraceManager.retrieveVmTrace(blockNumber, txNumber)}); + } }); diff --git a/src/index.js b/src/index.js index e1a3d7e32e..6968dea477 100644 --- a/src/index.js +++ b/src/index.js @@ -10,6 +10,6 @@ Web3Admin.extend(web3); var Debugger = require('./debugger'); ReactDOM.render( - , - document.getElementById('app') + , + document.getElementById('app') ); diff --git a/src/txBrowser.js b/src/txBrowser.js index 949298b7f0..5f770580c2 100644 --- a/src/txBrowser.js +++ b/src/txBrowser.js @@ -15,21 +15,21 @@ module.exports = React.createClass({ }, updateBlockN: function(ev) { - this.state.blockNumber = ev.target.value; + this.state.blockNumber = ev.target.value; }, updateTxN: function(ev) { - this.state.txNumber = ev.target.value; + this.state.txNumber = ev.target.value; }, render: function() { return ( -
+

Transaction details

-
- ); +
+ ); } }) diff --git a/src/vmTraceBrowser.js b/src/vmTraceBrowser.js index e3b90f8ffc..2704e68e2e 100644 --- a/src/vmTraceBrowser.js +++ b/src/vmTraceBrowser.js @@ -2,7 +2,7 @@ var React = require('react'); var AssemblyItemsBrowser = require('./assemblyItemsBrowser'); module.exports = React.createClass({ - render: function() { - return ( ) + render: function() { + return ( ) } }); diff --git a/src/web3Admin.js b/src/web3Admin.js index 92bc3b254d..1913f931b4 100644 --- a/src/web3Admin.js +++ b/src/web3Admin.js @@ -1,270 +1,270 @@ module.exports = { - extend: function(web3) { + extend: function(web3) { // ADMIN web3._extend({ - property: 'admin', - methods: - [ - new web3._extend.Method({ - name: 'addPeer', - call: 'admin_addPeer', - params: 1, - inputFormatter: [web3._extend.utils.fromDecimal], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'exportChain', - call: 'admin_exportChain', - params: 1, - inputFormatter: [null], - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Method({ - name: 'importChain', - call: 'admin_importChain', - params: 1, - inputFormatter: [null], - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Method({ - name: 'verbosity', - call: 'admin_verbosity', - params: 1, - inputFormatter: [web3._extend.utils.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'setSolc', - call: 'admin_setSolc', - params: 1, - inputFormatter: [null], - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Method({ - name: 'startRPC', - call: 'admin_startRPC', - params: 4, - inputFormatter: [null,web3._extend.utils.formatInputInteger,null,null], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'stopRPC', - call: 'admin_stopRPC', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'vmTrace', - call: 'admin_eth_vmTrace', - inputFormatter: [null, null], - params: 2 - }), - ], - properties: - [ - new web3._extend.Property({ - name: 'nodeInfo', - getter: 'admin_nodeInfo', - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Property({ - name: 'peers', - getter: 'admin_peers', - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Property({ - name: 'datadir', - getter: 'admin_datadir', - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Property({ - name: 'chainSyncStatus', - getter: 'admin_chainSyncStatus', - outputFormatter: function(obj) { return obj; } - }) - ] + property: 'admin', + methods: + [ + new web3._extend.Method({ + name: 'addPeer', + call: 'admin_addPeer', + params: 1, + inputFormatter: [web3._extend.utils.fromDecimal], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'exportChain', + call: 'admin_exportChain', + params: 1, + inputFormatter: [null], + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Method({ + name: 'importChain', + call: 'admin_importChain', + params: 1, + inputFormatter: [null], + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Method({ + name: 'verbosity', + call: 'admin_verbosity', + params: 1, + inputFormatter: [web3._extend.utils.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'setSolc', + call: 'admin_setSolc', + params: 1, + inputFormatter: [null], + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Method({ + name: 'startRPC', + call: 'admin_startRPC', + params: 4, + inputFormatter: [null,web3._extend.utils.formatInputInteger,null,null], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'stopRPC', + call: 'admin_stopRPC', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'vmTrace', + call: 'admin_eth_vmTrace', + inputFormatter: [null, null], + params: 2 + }), + ], + properties: + [ + new web3._extend.Property({ + name: 'nodeInfo', + getter: 'admin_nodeInfo', + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Property({ + name: 'peers', + getter: 'admin_peers', + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Property({ + name: 'datadir', + getter: 'admin_datadir', + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Property({ + name: 'chainSyncStatus', + getter: 'admin_chainSyncStatus', + outputFormatter: function(obj) { return obj; } + }) + ] }); // DEBUG web3._extend({ - property: 'debug', - methods: - [ - new web3._extend.Method({ - name: 'printBlock', - call: 'debug_printBlock', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Method({ - name: 'getBlockRlp', - call: 'debug_getBlockRlp', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Method({ - name: 'setHead', - call: 'debug_setHead', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'processBlock', - call: 'debug_processBlock', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Method({ - name: 'seedHash', - call: 'debug_seedHash', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputString - }) , - new web3._extend.Method({ - name: 'dumpBlock', - call: 'debug_dumpBlock', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: function(obj) { return obj; } - }) - ], - properties: - [ - ] + property: 'debug', + methods: + [ + new web3._extend.Method({ + name: 'printBlock', + call: 'debug_printBlock', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Method({ + name: 'getBlockRlp', + call: 'debug_getBlockRlp', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Method({ + name: 'setHead', + call: 'debug_setHead', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'processBlock', + call: 'debug_processBlock', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Method({ + name: 'seedHash', + call: 'debug_seedHash', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputString + }) , + new web3._extend.Method({ + name: 'dumpBlock', + call: 'debug_dumpBlock', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: function(obj) { return obj; } + }) + ], + properties: + [ + ] }); // MINER web3._extend({ - property: 'miner', - methods: - [ - new web3._extend.Method({ - name: 'start', - call: 'miner_start', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'stop', - call: 'miner_stop', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'setExtra', - call: 'miner_setExtra', - params: 1, - inputFormatter: [web3._extend.utils.formatInputString], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'setGasPrice', - call: 'miner_setGasPrice', - params: 1, - inputFormatter: [web3._extend.utils.formatInputString], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'startAutoDAG', - call: 'miner_startAutoDAG', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'stopAutoDAG', - call: 'miner_stopAutoDAG', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'makeDAG', - call: 'miner_makeDAG', - params: 1, - inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter], - outputFormatter: web3._extend.formatters.formatOutputBool - }) - ], - properties: - [ - new web3._extend.Property({ - name: 'hashrate', - getter: 'miner_hashrate', - outputFormatter: web3._extend.utils.toDecimal - }) - ] + property: 'miner', + methods: + [ + new web3._extend.Method({ + name: 'start', + call: 'miner_start', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'stop', + call: 'miner_stop', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'setExtra', + call: 'miner_setExtra', + params: 1, + inputFormatter: [web3._extend.utils.formatInputString], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'setGasPrice', + call: 'miner_setGasPrice', + params: 1, + inputFormatter: [web3._extend.utils.formatInputString], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'startAutoDAG', + call: 'miner_startAutoDAG', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'stopAutoDAG', + call: 'miner_stopAutoDAG', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'makeDAG', + call: 'miner_makeDAG', + params: 1, + inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter], + outputFormatter: web3._extend.formatters.formatOutputBool + }) + ], + properties: + [ + new web3._extend.Property({ + name: 'hashrate', + getter: 'miner_hashrate', + outputFormatter: web3._extend.utils.toDecimal + }) + ] }); // NETWORK web3._extend({ - property: 'network', - methods: - [ - new web3._extend.Method({ - name: 'addPeer', - call: 'net_addPeer', - params: 1, - inputFormatter: [web3._extend.utils.formatInputString], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'getPeerCount', - call: 'net_peerCount', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputString - }) - ], - properties: - [ - new web3._extend.Property({ - name: 'listening', - getter: 'net_listening', - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Property({ - name: 'peerCount', - getter: 'net_peerCount', - outputFormatter: web3._extend.utils.toDecimal - }), - new web3._extend.Property({ - name: 'peers', - getter: 'net_peers', - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Property({ - name: 'version', - getter: 'net_version', - outputFormatter: web3._extend.formatters.formatOutputString - }) - ] + property: 'network', + methods: + [ + new web3._extend.Method({ + name: 'addPeer', + call: 'net_addPeer', + params: 1, + inputFormatter: [web3._extend.utils.formatInputString], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'getPeerCount', + call: 'net_peerCount', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputString + }) + ], + properties: + [ + new web3._extend.Property({ + name: 'listening', + getter: 'net_listening', + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Property({ + name: 'peerCount', + getter: 'net_peerCount', + outputFormatter: web3._extend.utils.toDecimal + }), + new web3._extend.Property({ + name: 'peers', + getter: 'net_peers', + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Property({ + name: 'version', + getter: 'net_version', + outputFormatter: web3._extend.formatters.formatOutputString + }) + ] }); // TX POOL web3._extend({ - property: 'txpool', - methods: - [ - ], - properties: - [ - new web3._extend.Property({ - name: 'status', - getter: 'txpool_status', - outputFormatter: function(obj) { return obj; } - }) - ] + property: 'txpool', + methods: + [ + ], + properties: + [ + new web3._extend.Property({ + name: 'status', + getter: 'txpool_status', + outputFormatter: function(obj) { return obj; } + }) + ] }); - } -}; + } + }; From ee58c47b8b8c95d46ee7c7b6e0bba1a31f4967b8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 18 Apr 2016 15:50:10 +0200 Subject: [PATCH 3/3] indent --- src/debugger.js | 2 +- src/web3Admin.js | 492 +++++++++++++++++++++++------------------------ 2 files changed, 247 insertions(+), 247 deletions(-) diff --git a/src/debugger.js b/src/debugger.js index 879b906e95..a86fe6b9f6 100644 --- a/src/debugger.js +++ b/src/debugger.js @@ -19,7 +19,7 @@ module.exports = React.createClass({ }, retrieveVmTrace: function(blockNumber, txNumber) - { + { this.setState({vmTrace: VmTraceManager.retrieveVmTrace(blockNumber, txNumber)}); } }); diff --git a/src/web3Admin.js b/src/web3Admin.js index 1913f931b4..0a51bb1a0f 100644 --- a/src/web3Admin.js +++ b/src/web3Admin.js @@ -1,269 +1,269 @@ module.exports = { - extend: function(web3) { + extend: function(web3) { // ADMIN web3._extend({ - property: 'admin', - methods: - [ - new web3._extend.Method({ - name: 'addPeer', - call: 'admin_addPeer', - params: 1, - inputFormatter: [web3._extend.utils.fromDecimal], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'exportChain', - call: 'admin_exportChain', - params: 1, - inputFormatter: [null], - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Method({ - name: 'importChain', - call: 'admin_importChain', - params: 1, - inputFormatter: [null], - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Method({ - name: 'verbosity', - call: 'admin_verbosity', - params: 1, - inputFormatter: [web3._extend.utils.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'setSolc', - call: 'admin_setSolc', - params: 1, - inputFormatter: [null], - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Method({ - name: 'startRPC', - call: 'admin_startRPC', - params: 4, - inputFormatter: [null,web3._extend.utils.formatInputInteger,null,null], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'stopRPC', - call: 'admin_stopRPC', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'vmTrace', - call: 'admin_eth_vmTrace', - inputFormatter: [null, null], - params: 2 - }), - ], - properties: - [ - new web3._extend.Property({ - name: 'nodeInfo', - getter: 'admin_nodeInfo', - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Property({ - name: 'peers', - getter: 'admin_peers', - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Property({ - name: 'datadir', - getter: 'admin_datadir', - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Property({ - name: 'chainSyncStatus', - getter: 'admin_chainSyncStatus', - outputFormatter: function(obj) { return obj; } - }) - ] + property: 'admin', + methods: + [ + new web3._extend.Method({ + name: 'addPeer', + call: 'admin_addPeer', + params: 1, + inputFormatter: [web3._extend.utils.fromDecimal], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'exportChain', + call: 'admin_exportChain', + params: 1, + inputFormatter: [null], + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Method({ + name: 'importChain', + call: 'admin_importChain', + params: 1, + inputFormatter: [null], + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Method({ + name: 'verbosity', + call: 'admin_verbosity', + params: 1, + inputFormatter: [web3._extend.utils.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'setSolc', + call: 'admin_setSolc', + params: 1, + inputFormatter: [null], + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Method({ + name: 'startRPC', + call: 'admin_startRPC', + params: 4, + inputFormatter: [null,web3._extend.utils.formatInputInteger,null,null], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'stopRPC', + call: 'admin_stopRPC', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'vmTrace', + call: 'admin_eth_vmTrace', + inputFormatter: [null, null], + params: 2 + }), + ], + properties: + [ + new web3._extend.Property({ + name: 'nodeInfo', + getter: 'admin_nodeInfo', + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Property({ + name: 'peers', + getter: 'admin_peers', + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Property({ + name: 'datadir', + getter: 'admin_datadir', + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Property({ + name: 'chainSyncStatus', + getter: 'admin_chainSyncStatus', + outputFormatter: function(obj) { return obj; } + }) + ] }); // DEBUG web3._extend({ - property: 'debug', - methods: - [ - new web3._extend.Method({ - name: 'printBlock', - call: 'debug_printBlock', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Method({ - name: 'getBlockRlp', - call: 'debug_getBlockRlp', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputString - }), - new web3._extend.Method({ - name: 'setHead', - call: 'debug_setHead', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'processBlock', - call: 'debug_processBlock', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Method({ - name: 'seedHash', - call: 'debug_seedHash', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputString - }) , - new web3._extend.Method({ - name: 'dumpBlock', - call: 'debug_dumpBlock', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: function(obj) { return obj; } - }) - ], - properties: - [ - ] + property: 'debug', + methods: + [ + new web3._extend.Method({ + name: 'printBlock', + call: 'debug_printBlock', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Method({ + name: 'getBlockRlp', + call: 'debug_getBlockRlp', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputString + }), + new web3._extend.Method({ + name: 'setHead', + call: 'debug_setHead', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'processBlock', + call: 'debug_processBlock', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Method({ + name: 'seedHash', + call: 'debug_seedHash', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputString + }) , + new web3._extend.Method({ + name: 'dumpBlock', + call: 'debug_dumpBlock', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: function(obj) { return obj; } + }) + ], + properties: + [ + ] }); // MINER web3._extend({ - property: 'miner', - methods: - [ - new web3._extend.Method({ - name: 'start', - call: 'miner_start', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'stop', - call: 'miner_stop', - params: 1, - inputFormatter: [web3._extend.formatters.formatInputInt], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'setExtra', - call: 'miner_setExtra', - params: 1, - inputFormatter: [web3._extend.utils.formatInputString], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'setGasPrice', - call: 'miner_setGasPrice', - params: 1, - inputFormatter: [web3._extend.utils.formatInputString], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'startAutoDAG', - call: 'miner_startAutoDAG', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'stopAutoDAG', - call: 'miner_stopAutoDAG', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'makeDAG', - call: 'miner_makeDAG', - params: 1, - inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter], - outputFormatter: web3._extend.formatters.formatOutputBool - }) - ], - properties: - [ - new web3._extend.Property({ - name: 'hashrate', - getter: 'miner_hashrate', - outputFormatter: web3._extend.utils.toDecimal - }) - ] + property: 'miner', + methods: + [ + new web3._extend.Method({ + name: 'start', + call: 'miner_start', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'stop', + call: 'miner_stop', + params: 1, + inputFormatter: [web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'setExtra', + call: 'miner_setExtra', + params: 1, + inputFormatter: [web3._extend.utils.formatInputString], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'setGasPrice', + call: 'miner_setGasPrice', + params: 1, + inputFormatter: [web3._extend.utils.formatInputString], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'startAutoDAG', + call: 'miner_startAutoDAG', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'stopAutoDAG', + call: 'miner_stopAutoDAG', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'makeDAG', + call: 'miner_makeDAG', + params: 1, + inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter], + outputFormatter: web3._extend.formatters.formatOutputBool + }) + ], + properties: + [ + new web3._extend.Property({ + name: 'hashrate', + getter: 'miner_hashrate', + outputFormatter: web3._extend.utils.toDecimal + }) + ] }); // NETWORK web3._extend({ - property: 'network', - methods: - [ - new web3._extend.Method({ - name: 'addPeer', - call: 'net_addPeer', - params: 1, - inputFormatter: [web3._extend.utils.formatInputString], - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Method({ - name: 'getPeerCount', - call: 'net_peerCount', - params: 0, - inputFormatter: [], - outputFormatter: web3._extend.formatters.formatOutputString - }) - ], - properties: - [ - new web3._extend.Property({ - name: 'listening', - getter: 'net_listening', - outputFormatter: web3._extend.formatters.formatOutputBool - }), - new web3._extend.Property({ - name: 'peerCount', - getter: 'net_peerCount', - outputFormatter: web3._extend.utils.toDecimal - }), - new web3._extend.Property({ - name: 'peers', - getter: 'net_peers', - outputFormatter: function(obj) { return obj; } - }), - new web3._extend.Property({ - name: 'version', - getter: 'net_version', - outputFormatter: web3._extend.formatters.formatOutputString - }) - ] + property: 'network', + methods: + [ + new web3._extend.Method({ + name: 'addPeer', + call: 'net_addPeer', + params: 1, + inputFormatter: [web3._extend.utils.formatInputString], + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Method({ + name: 'getPeerCount', + call: 'net_peerCount', + params: 0, + inputFormatter: [], + outputFormatter: web3._extend.formatters.formatOutputString + }) + ], + properties: + [ + new web3._extend.Property({ + name: 'listening', + getter: 'net_listening', + outputFormatter: web3._extend.formatters.formatOutputBool + }), + new web3._extend.Property({ + name: 'peerCount', + getter: 'net_peerCount', + outputFormatter: web3._extend.utils.toDecimal + }), + new web3._extend.Property({ + name: 'peers', + getter: 'net_peers', + outputFormatter: function(obj) { return obj; } + }), + new web3._extend.Property({ + name: 'version', + getter: 'net_version', + outputFormatter: web3._extend.formatters.formatOutputString + }) + ] }); // TX POOL web3._extend({ - property: 'txpool', - methods: - [ - ], - properties: - [ - new web3._extend.Property({ - name: 'status', - getter: 'txpool_status', - outputFormatter: function(obj) { return obj; } - }) - ] + property: 'txpool', + methods: + [ + ], + properties: + [ + new web3._extend.Property({ + name: 'status', + getter: 'txpool_status', + outputFormatter: function(obj) { return obj; } + }) + ] }); } };