aboutsummaryrefslogtreecommitdiffstats
path: root/RPCTests/modules
diff options
context:
space:
mode:
authorDimitry <dimitry@ethdev.com>2017-03-08 19:11:16 +0800
committerDimitry <dimitry@ethdev.com>2017-03-08 19:11:16 +0800
commit8fc7755279f7aa53352d659a80dc7128615a2a42 (patch)
treeaf480a5b084dee5cae21d46c81ac834186397ad1 /RPCTests/modules
parent0e7c51bb0a4755a2bebe11c72a579a962b3c205b (diff)
downloaddexon-tests-8fc7755279f7aa53352d659a80dc7128615a2a42.tar
dexon-tests-8fc7755279f7aa53352d659a80dc7128615a2a42.tar.gz
dexon-tests-8fc7755279f7aa53352d659a80dc7128615a2a42.tar.bz2
dexon-tests-8fc7755279f7aa53352d659a80dc7128615a2a42.tar.lz
dexon-tests-8fc7755279f7aa53352d659a80dc7128615a2a42.tar.xz
dexon-tests-8fc7755279f7aa53352d659a80dc7128615a2a42.tar.zst
dexon-tests-8fc7755279f7aa53352d659a80dc7128615a2a42.zip
use npm install to download web3 dependencies
Diffstat (limited to 'RPCTests/modules')
-rw-r--r--RPCTests/modules/ethconsole.js4
m---------RPCTests/modules/ethereum-console0
-rw-r--r--RPCTests/modules/web3Admin.js320
3 files changed, 322 insertions, 2 deletions
diff --git a/RPCTests/modules/ethconsole.js b/RPCTests/modules/ethconsole.js
index d3ee707bb..de6cae5af 100644
--- a/RPCTests/modules/ethconsole.js
+++ b/RPCTests/modules/ethconsole.js
@@ -52,8 +52,8 @@ runScriptOnNode: function runScriptOnNode(dataDir, jsScript, args, finished)
var utils = require('./utils.js');
var ipcPath = dataDir + '/geth.ipc';
- var Web3 = require('./ethereum-console/node_modules/web3');
- var web3admin = require('./ethereum-console/web3Admin.js');
+ var Web3 = require('web3');
+ var web3admin = require('./web3Admin.js');
var net = require('net');
utils.cLog("Connecting to node at " + ipcPath);
diff --git a/RPCTests/modules/ethereum-console b/RPCTests/modules/ethereum-console
deleted file mode 160000
-Subproject 08515536fa81889a802295a2769068577e799bf
diff --git a/RPCTests/modules/web3Admin.js b/RPCTests/modules/web3Admin.js
new file mode 100644
index 000000000..819a87f30
--- /dev/null
+++ b/RPCTests/modules/web3Admin.js
@@ -0,0 +1,320 @@
+module.exports = {
+ extend: function(web3) {
+
+ // ADMIN
+ web3._extend({
+ property: 'admin',
+ methods:
+ [
+ new web3._extend.Method({
+ name: 'addPeer',
+ call: 'admin_addPeer',
+ params: 1,
+ inputFormatter: [web3._extend.utils.formatInputString],
+ 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
+ })
+ ],
+ 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; }
+ }),
+ new web3._extend.Method({
+ name: 'traceTransaction',
+ call: 'debug_traceTransaction',
+ inputFormatter: [null, null],
+ params: 2
+ }),
+ new web3._extend.Method({
+ name: 'storageRangeAt',
+ call: 'debug_storageRangeAt',
+ inputFormatter: [null, null, null, null, null],
+ params: 5
+ })
+ ],
+ 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
+ })
+ ]
+ });
+
+ // 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
+ })
+ ]
+ });
+
+ // TX POOL
+ web3._extend({
+ property: 'txpool',
+ methods:
+ [
+ ],
+ properties:
+ [
+ new web3._extend.Property({
+ name: 'status',
+ getter: 'txpool_status',
+ outputFormatter: function(obj) { return obj; }
+ })
+ ]
+ });
+
+ // TEST
+ web3._extend({
+ property: 'test',
+ methods:
+ [
+ new web3._extend.Method({
+ name: 'setChainParams',
+ call: 'test_setChainParams',
+ params: 1,
+ outputFormatter: web3._extend.formatters.formatOutputBool
+ }),
+ new web3._extend.Method({
+ name: 'mineBlocks',
+ call: 'test_mineBlocks',
+ params: 1,
+ inputFormatter: [web3._extend.utils.formatInputInt],
+ outputFormatter: web3._extend.formatters.formatOutputBool
+ }),
+ new web3._extend.Method({
+ name: 'modifyTimestamp',
+ call: 'test_modifyTimestamp',
+ params: 1,
+ inputFormatter: [web3._extend.utils.formatInputInt],
+ outputFormatter: web3._extend.formatters.formatOutputBool
+ }),
+ new web3._extend.Method({
+ name: 'addBlock',
+ call: 'test_addBlock',
+ params: 1,
+ inputFormatter: [web3._extend.utils.formatInputString],
+ outputFormatter: web3._extend.formatters.formatOutputBool
+ }),
+ new web3._extend.Method({
+ name: 'rewindToBlock',
+ call: 'test_rewindToBlock',
+ params: 1,
+ inputFormatter: [web3._extend.utils.formatInputInt],
+ outputFormatter: web3._extend.formatters.formatOutputBool
+ })
+ ],
+ properties:
+ [
+ ]
+ });
+ }
+};