Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
ceb0739b
Commit
ceb0739b
authored
Jul 06, 2015
by
Bas van Kervel
Committed by
Jeffrey Wilcke
Jul 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed web3 formatters mismatch
parent
6ea28f93
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
174 deletions
+73
-174
admin_js.go
rpc/api/admin_js.go
+13
-26
db_js.go
rpc/api/db_js.go
+0
-28
debug_js.go
rpc/api/debug_js.go
+8
-15
eth_js.go
rpc/api/eth_js.go
+3
-6
miner_js.go
rpc/api/miner_js.go
+7
-14
net_js.go
rpc/api/net_js.go
+4
-24
personal_js.go
rpc/api/personal_js.go
+4
-6
ssh_js.go
rpc/api/ssh_js.go
+2
-14
utils.go
rpc/api/utils.go
+32
-41
No files found.
rpc/api/admin_js.go
View file @
ceb0739b
...
@@ -9,22 +9,19 @@ web3._extend({
...
@@ -9,22 +9,19 @@ web3._extend({
name: 'addPeer',
name: 'addPeer',
call: 'admin_addPeer',
call: 'admin_addPeer',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'exportChain',
name: 'exportChain',
call: 'admin_exportChain',
call: 'admin_exportChain',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null]
outputFormatter: function(obj) { return obj; }
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'importChain',
name: 'importChain',
call: 'admin_importChain',
call: 'admin_importChain',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null]
outputFormatter: function(obj) { return obj; }
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'sleepBlocks',
name: 'sleepBlocks',
...
@@ -37,22 +34,19 @@ web3._extend({
...
@@ -37,22 +34,19 @@ web3._extend({
name: 'verbosity',
name: 'verbosity',
call: 'admin_verbosity',
call: 'admin_verbosity',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputInt],
inputFormatter: [web3._extend.utils.toDecimal]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'setSolc',
name: 'setSolc',
call: 'admin_setSolc',
call: 'admin_setSolc',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null]
outputFormatter: web3._extend.formatters.formatOutputString
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'startRPC',
name: 'startRPC',
call: 'admin_startRPC',
call: 'admin_startRPC',
params: 4,
params: 4,
inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputInteger,web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
inputFormatter: [null, web3._extend.utils.toDecimal, null, null]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'stopRPC',
name: 'stopRPC',
...
@@ -114,22 +108,19 @@ web3._extend({
...
@@ -114,22 +108,19 @@ web3._extend({
name: 'stopNatSpec',
name: 'stopNatSpec',
call: 'admin_stopNatSpec',
call: 'admin_stopNatSpec',
params: 0,
params: 0,
inputFormatter: [],
inputFormatter: []
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'getContractInfo',
name: 'getContractInfo',
call: 'admin_getContractInfo',
call: 'admin_getContractInfo',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null],
outputFormatter: function(obj) { return json.parse(obj); }
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'httpGet',
name: 'httpGet',
call: 'admin_httpGet',
call: 'admin_httpGet',
params: 2,
params: 2,
inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
inputFormatter: [null, null]
outputFormatter: web3._extend.formatters.formatOutputString
})
})
],
],
...
@@ -137,23 +128,19 @@ web3._extend({
...
@@ -137,23 +128,19 @@ web3._extend({
[
[
new web3._extend.Property({
new web3._extend.Property({
name: 'nodeInfo',
name: 'nodeInfo',
getter: 'admin_nodeInfo',
getter: 'admin_nodeInfo'
outputFormatter: web3._extend.formatters.formatOutputString
}),
}),
new web3._extend.Property({
new web3._extend.Property({
name: 'peers',
name: 'peers',
getter: 'admin_peers',
getter: 'admin_peers'
outputFormatter: function(obj) { return obj; }
}),
}),
new web3._extend.Property({
new web3._extend.Property({
name: 'datadir',
name: 'datadir',
getter: 'admin_datadir',
getter: 'admin_datadir'
outputFormatter: web3._extend.formatters.formatOutputString
}),
}),
new web3._extend.Property({
new web3._extend.Property({
name: 'chainSyncStatus',
name: 'chainSyncStatus',
getter: 'admin_chainSyncStatus',
getter: 'admin_chainSyncStatus'
outputFormatter: function(obj) { return obj; }
})
})
]
]
});
});
...
...
rpc/api/db_js.go
View file @
ceb0739b
...
@@ -5,34 +5,6 @@ web3._extend({
...
@@ -5,34 +5,6 @@ web3._extend({
property: 'db',
property: 'db',
methods:
methods:
[
[
new web3._extend.Method({
name: 'getString',
call: 'db_getString',
params: 2,
inputFormatter: [web3._extend.formatters.formatInputString, web3._extend.formatters.formatInputString],
outputFormatter: web3._extend.formatters.formatOutputString
}),
new web3._extend.Method({
name: 'putString',
call: 'db_putString',
params: 3,
inputFormatter: [web3._extend.formatters.formatInputString, web3._extend.formatters.formatInputString, web3._extend.formatters.formatInputString],
outputFormatter: web3._extend.formatters.formatOutputBool
}),
new web3._extend.Method({
name: 'getHex',
call: 'db_getHex',
params: 2,
inputFormatter: [web3._extend.formatters.formatInputString, web3._extend.formatters.formatInputString],
outputFormatter: web3._extend.formatters.formatOutputString
}),
new web3._extend.Method({
name: 'putHex',
call: 'db_putHex',
params: 3,
inputFormatter: [web3._extend.formatters.formatInputString, web3._extend.formatters.formatInputString, web3._extend.formatters.formatInputString],
outputFormatter: web3._extend.formatters.formatOutputBool
}),
],
],
properties:
properties:
[
[
...
...
rpc/api/debug_js.go
View file @
ceb0739b
...
@@ -9,50 +9,43 @@ web3._extend({
...
@@ -9,50 +9,43 @@ web3._extend({
name: 'printBlock',
name: 'printBlock',
call: 'debug_printBlock',
call: 'debug_printBlock',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
outputFormatter: web3._extend.formatters.formatOutputString
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'getBlockRlp',
name: 'getBlockRlp',
call: 'debug_getBlockRlp',
call: 'debug_getBlockRlp',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
outputFormatter: web3._extend.formatters.formatOutputString
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'setHead',
name: 'setHead',
call: 'debug_setHead',
call: 'debug_setHead',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'processBlock',
name: 'processBlock',
call: 'debug_processBlock',
call: 'debug_processBlock',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
outputFormatter: function(obj) { return obj; }
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'seedHash',
name: 'seedHash',
call: 'debug_seedHash',
call: 'debug_seedHash',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
outputFormatter: web3._extend.formatters.formatOutputString
}),
}) ,
new web3._extend.Method({
new web3._extend.Method({
name: 'dumpBlock',
name: 'dumpBlock',
call: 'debug_dumpBlock',
call: 'debug_dumpBlock',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
outputFormatter: function(obj) { return obj; }
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'metrics',
name: 'metrics',
call: 'debug_metrics',
call: 'debug_metrics',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputBool],
inputFormatter: [null]
outputFormatter: function(obj) { return obj; }
})
})
],
],
properties:
properties:
...
...
rpc/api/eth_js.go
View file @
ceb0739b
...
@@ -12,23 +12,20 @@ web3._extend({
...
@@ -12,23 +12,20 @@ web3._extend({
name: 'sign',
name: 'sign',
call: 'eth_sign',
call: 'eth_sign',
params: 2,
params: 2,
inputFormatter: [web3._extend.formatters.formatInputString,web3._extend.formatters.formatInputString],
inputFormatter: [web3._extend.utils.toAddress, null]
outputFormatter: web3._extend.formatters.formatOutputString
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'resend',
name: 'resend',
call: 'eth_resend',
call: 'eth_resend',
params: 3,
params: 3,
inputFormatter: [function(obj) { return obj; },web3._extend.formatters.formatInputString,web3._extend.formatters.formatInputString],
inputFormatter: [null, null, null]
outputFormatter: web3._extend.formatters.formatOutputString
})
})
],
],
properties:
properties:
[
[
new web3._extend.Property({
new web3._extend.Property({
name: 'pendingTransactions',
name: 'pendingTransactions',
getter: 'eth_pendingTransactions',
getter: 'eth_pendingTransactions'
outputFormatter: function(obj) { return obj; }
})
})
]
]
});
});
...
...
rpc/api/miner_js.go
View file @
ceb0739b
...
@@ -9,50 +9,43 @@ web3._extend({
...
@@ -9,50 +9,43 @@ web3._extend({
name: 'start',
name: 'start',
call: 'miner_start',
call: 'miner_start',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [null]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'stop',
name: 'stop',
call: 'miner_stop',
call: 'miner_stop',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.formatInputInt],
inputFormatter: [null]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'setExtra',
name: 'setExtra',
call: 'miner_setExtra',
call: 'miner_setExtra',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'setGasPrice',
name: 'setGasPrice',
call: 'miner_setGasPrice',
call: 'miner_setGasPrice',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'startAutoDAG',
name: 'startAutoDAG',
call: 'miner_startAutoDAG',
call: 'miner_startAutoDAG',
params: 0,
params: 0,
inputFormatter: [],
inputFormatter: []
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'stopAutoDAG',
name: 'stopAutoDAG',
call: 'miner_stopAutoDAG',
call: 'miner_stopAutoDAG',
params: 0,
params: 0,
inputFormatter: [],
inputFormatter: []
outputFormatter: web3._extend.formatters.formatOutputBool
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'makeDAG',
name: 'makeDAG',
call: 'miner_makeDAG',
call: 'miner_makeDAG',
params: 1,
params: 1,
inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter],
inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter]
outputFormatter: web3._extend.formatters.formatOutputBool
})
})
],
],
properties:
properties:
...
...
rpc/api/net_js.go
View file @
ceb0739b
...
@@ -2,45 +2,25 @@ package api
...
@@ -2,45 +2,25 @@ package api
const
Net_JS
=
`
const
Net_JS
=
`
web3._extend({
web3._extend({
property: 'net
work
',
property: 'net',
methods:
methods:
[
[
new web3._extend.Method({
new web3._extend.Method({
name: 'addPeer',
name: 'addPeer',
call: 'net_addPeer',
call: 'net_addPeer',
params: 1,
params: 1,
inputFormatter: [web3._extend.utils.formatInputString],
inputFormatter: [null]
outputFormatter: web3._extend.formatters.formatOutputBool
}),
new web3._extend.Method({
name: 'getPeerCount',
call: 'net_peerCount',
params: 0,
inputFormatter: [],
outputFormatter: web3._extend.formatters.formatOutputString
})
})
],
],
properties:
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({
new web3._extend.Property({
name: 'peers',
name: 'peers',
getter: 'net_peers',
getter: 'net_peers'
outputFormatter: function(obj) { return obj; }
}),
}),
new web3._extend.Property({
new web3._extend.Property({
name: 'version',
name: 'version',
getter: 'net_version',
getter: 'net_version'
outputFormatter: web3._extend.formatters.formatOutputString
})
})
]
]
});
});
...
...
rpc/api/personal_js.go
View file @
ceb0739b
...
@@ -9,23 +9,21 @@ web3._extend({
...
@@ -9,23 +9,21 @@ web3._extend({
name: 'newAccount',
name: 'newAccount',
call: 'personal_newAccount',
call: 'personal_newAccount',
params: 1,
params: 1,
inputFormatter: [
web3._extend.formatters.formatInputString
],
inputFormatter: [
null
],
outputFormatter: web3._extend.
formatters.formatOutputString
outputFormatter: web3._extend.
utils.toAddress
}),
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'unlockAccount',
name: 'unlockAccount',
call: 'personal_unlockAccount',
call: 'personal_unlockAccount',
params: 3,
params: 3,
inputFormatter: [web3._extend.formatters.formatInputString,web3._extend.formatters.formatInputString,web3._extend.formatters.formatInputInt],
inputFormatter: [null, null, null]
outputFormatter: web3._extend.formatters.formatOutputBool
})
})
],
],
properties:
properties:
[
[
new web3._extend.Property({
new web3._extend.Property({
name: 'listAccounts',
name: 'listAccounts',
getter: 'personal_listAccounts',
getter: 'personal_listAccounts'
outputFormatter: function(obj) { return obj; }
})
})
]
]
});
});
...
...
rpc/api/ssh_js.go
View file @
ceb0739b
...
@@ -5,25 +5,13 @@ web3._extend({
...
@@ -5,25 +5,13 @@ web3._extend({
property: 'shh',
property: 'shh',
methods:
methods:
[
[
new web3._extend.Method({
name: 'post',
call: 'shh_post',
params: 6,
inputFormatter: [web3._extend.formatters.formatInputString,
web3._extend.formatters.formatInputString,
web3._extend.formatters.formatInputString,
,
, web3._extend.formatters.formatInputInt
, web3._extend.formatters.formatInputInt],
outputFormatter: web3._extend.formatters.formatOutputBool
}),
],
],
properties:
properties:
[
[
new web3._extend.Property({
new web3._extend.Property({
name: 'version',
name: 'version',
getter: 'shh_version',
getter: 'shh_version'
outputFormatter: web3._extend.formatters.formatOutputInt
})
})
]
]
});
});
...
...
rpc/api/utils.go
View file @
ceb0739b
...
@@ -36,6 +36,7 @@ var (
...
@@ -36,6 +36,7 @@ var (
"debug"
:
[]
string
{
"debug"
:
[]
string
{
"dumpBlock"
,
"dumpBlock"
,
"getBlockRlp"
,
"getBlockRlp"
,
"metrics"
,
"printBlock"
,
"printBlock"
,
"processBlock"
,
"processBlock"
,
"seedHash"
,
"seedHash"
,
...
@@ -44,49 +45,38 @@ var (
...
@@ -44,49 +45,38 @@ var (
"eth"
:
[]
string
{
"eth"
:
[]
string
{
"accounts"
,
"accounts"
,
"blockNumber"
,
"blockNumber"
,
"
getBalance
"
,
"
call
"
,
"
protocolVersion
"
,
"
contract
"
,
"coinbase"
,
"coinbase"
,
"mining"
,
"compile.lll"
,
"compile.serpent"
,
"compile.solidity"
,
"contract"
,
"defaultAccount"
,
"defaultBlock"
,
"estimateGas"
,
"filter"
,
"getBalance"
,
"getBlock"
,
"getBlockTransactionCount"
,
"getBlockUncleCount"
,
"getCode"
,
"getCompilers"
,
"gasPrice"
,
"gasPrice"
,
"getStorage"
,
"storageAt"
,
"getStorageAt"
,
"getStorageAt"
,
"getTransaction"
,
"getTransactionCount"
,
"getTransactionCount"
,
"getBlockTransactionCountByHash"
,
"getTransactionFromBlock"
,
"getBlockTransactionCountByNumber"
,
"getTransactionReceipt"
,
"getUncleCountByBlockHash"
,
"getUncle"
,
"getUncleCountByBlockNumber"
,
"getData"
,
"getCode"
,
"sign"
,
"sendRawTransaction"
,
"sendTransaction"
,
"transact"
,
"estimateGas"
,
"call"
,
"flush"
,
"getBlockByHash"
,
"getBlockByNumber"
,
"getTransactionByHash"
,
"getTransactionByBlockHashAndIndex"
,
"getUncleByBlockHashAndIndex"
,
"getUncleByBlockNumberAndIndex"
,
"getCompilers"
,
"compileSolidity"
,
"newFilter"
,
"newBlockFilter"
,
"newPendingTransactionFilter"
,
"uninstallFilter"
,
"getFilterChanges"
,
"getFilterLogs"
,
"getLogs"
,
"hashrate"
,
"hashrate"
,
"
getWork
"
,
"
mining
"
,
"
submitWork
"
,
"
namereg
"
,
"pendingTransactions"
,
"pendingTransactions"
,
"resend"
,
"resend"
,
"getTransactionReceipt"
,
"sendRawTransaction"
,
"sendTransaction"
,
"sign"
,
},
},
"miner"
:
[]
string
{
"miner"
:
[]
string
{
"hashrate"
,
"hashrate"
,
...
@@ -101,6 +91,8 @@ var (
...
@@ -101,6 +91,8 @@ var (
"net"
:
[]
string
{
"net"
:
[]
string
{
"peerCount"
,
"peerCount"
,
"listening"
,
"listening"
,
"version"
,
"peers"
,
},
},
"personal"
:
[]
string
{
"personal"
:
[]
string
{
"listAccounts"
,
"listAccounts"
,
...
@@ -109,13 +101,12 @@ var (
...
@@ -109,13 +101,12 @@ var (
"unlockAccount"
,
"unlockAccount"
,
},
},
"shh"
:
[]
string
{
"shh"
:
[]
string
{
"version"
,
"post"
,
"post"
,
"newIdentify"
,
"hasIdentity"
,
"hasIdentity"
,
"newIdentity"
,
"newGroup"
,
"newFilter"
,
"addToGroup"
,
"uninstallFilter"
,
"filter"
,
"getFilterChanges"
,
},
},
"txpool"
:
[]
string
{
"txpool"
:
[]
string
{
"status"
,
"status"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment