diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-07-06 21:59:36 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 17:30:23 +0800 |
commit | 7e6c1f8024d0cc0f381c615cab3c97b57fc9515e (patch) | |
tree | e9eee95bdf3a6ca55b39328d7dc2a32d18a8e31e /rpc/api | |
parent | ceb0739ba111215d47cc2ff9d80d542fa26d764a (diff) | |
download | dexon-7e6c1f8024d0cc0f381c615cab3c97b57fc9515e.tar.gz dexon-7e6c1f8024d0cc0f381c615cab3c97b57fc9515e.tar.zst dexon-7e6c1f8024d0cc0f381c615cab3c97b57fc9515e.zip |
corrected input formatters as suggested during review
Diffstat (limited to 'rpc/api')
-rw-r--r-- | rpc/api/admin_js.go | 4 | ||||
-rw-r--r-- | rpc/api/eth_js.go | 2 | ||||
-rw-r--r-- | rpc/api/miner_js.go | 2 | ||||
-rw-r--r-- | rpc/api/net.go | 10 | ||||
-rw-r--r-- | rpc/api/net_js.go | 8 | ||||
-rw-r--r-- | rpc/api/utils.go | 2 |
6 files changed, 4 insertions, 24 deletions
diff --git a/rpc/api/admin_js.go b/rpc/api/admin_js.go index e528b8863..86a4f6a4c 100644 --- a/rpc/api/admin_js.go +++ b/rpc/api/admin_js.go @@ -34,7 +34,7 @@ web3._extend({ name: 'verbosity', call: 'admin_verbosity', params: 1, - inputFormatter: [web3._extend.utils.toDecimal] + inputFormatter: [web3._extend.utils.fromDecimal] }), new web3._extend.Method({ name: 'setSolc', @@ -46,7 +46,7 @@ web3._extend({ name: 'startRPC', call: 'admin_startRPC', params: 4, - inputFormatter: [null, web3._extend.utils.toDecimal, null, null] + inputFormatter: [null, null, null, null] }), new web3._extend.Method({ name: 'stopRPC', diff --git a/rpc/api/eth_js.go b/rpc/api/eth_js.go index 4c3e9e4db..400eb8e89 100644 --- a/rpc/api/eth_js.go +++ b/rpc/api/eth_js.go @@ -18,7 +18,7 @@ web3._extend({ name: 'resend', call: 'eth_resend', params: 3, - inputFormatter: [null, null, null] + inputFormatter: [web3._extend.formatters.inputTransactionFormatter, web3._extend.utils.fromDecimal, web3._extend.utils.fromDecimal] }) ], properties: diff --git a/rpc/api/miner_js.go b/rpc/api/miner_js.go index 6474166e7..8861a177a 100644 --- a/rpc/api/miner_js.go +++ b/rpc/api/miner_js.go @@ -27,7 +27,7 @@ web3._extend({ name: 'setGasPrice', call: 'miner_setGasPrice', params: 1, - inputFormatter: [null] + inputFormatter: [web3._extend.utils.fromDecial] }), new web3._extend.Method({ name: 'startAutoDAG', diff --git a/rpc/api/net.go b/rpc/api/net.go index 761654661..b3931ba2d 100644 --- a/rpc/api/net.go +++ b/rpc/api/net.go @@ -14,10 +14,8 @@ const ( var ( // mapping between methods and handlers netMapping = map[string]nethandler{ - "net_version": (*netApi).Version, "net_peerCount": (*netApi).PeerCount, "net_listening": (*netApi).IsListening, - "net_peers": (*netApi).Peers, } ) @@ -70,11 +68,6 @@ func (self *netApi) ApiVersion() string { return NetApiVersion } -// Network version -func (self *netApi) Version(req *shared.Request) (interface{}, error) { - return self.xeth.NetworkVersion(), nil -} - // Number of connected peers func (self *netApi) PeerCount(req *shared.Request) (interface{}, error) { return newHexNum(self.xeth.PeerCount()), nil @@ -84,6 +77,3 @@ func (self *netApi) IsListening(req *shared.Request) (interface{}, error) { return self.xeth.IsListening(), nil } -func (self *netApi) Peers(req *shared.Request) (interface{}, error) { - return self.ethereum.PeersInfo(), nil -} diff --git a/rpc/api/net_js.go b/rpc/api/net_js.go index cc8d7f46e..2f872393c 100644 --- a/rpc/api/net_js.go +++ b/rpc/api/net_js.go @@ -14,14 +14,6 @@ web3._extend({ ], properties: [ - new web3._extend.Property({ - name: 'peers', - getter: 'net_peers' - }), - new web3._extend.Property({ - name: 'version', - getter: 'net_version' - }) ] }); ` diff --git a/rpc/api/utils.go b/rpc/api/utils.go index a96d105fb..d64cfc7cf 100644 --- a/rpc/api/utils.go +++ b/rpc/api/utils.go @@ -91,8 +91,6 @@ var ( "net": []string{ "peerCount", "listening", - "version", - "peers", }, "personal": []string{ "listAccounts", |