fixed rpc test failure in eth.blockNumber

This commit is contained in:
Bas van Kervel 2015-06-16 15:40:24 +02:00
parent 9ac1b4e59e
commit 3e1d635f8d

View File

@ -55,6 +55,7 @@ var (
"eth_getBlockByHash": (*ethApi).GetBlockByHash, "eth_getBlockByHash": (*ethApi).GetBlockByHash,
"eth_getBlockByNumber": (*ethApi).GetBlockByNumber, "eth_getBlockByNumber": (*ethApi).GetBlockByNumber,
"eth_getTransactionByHash": (*ethApi).GetTransactionByHash, "eth_getTransactionByHash": (*ethApi).GetTransactionByHash,
"eth_getTransactionByBlockNumberAndIndex": (*ethApi).GetTransactionByBlockNumberAndIndex,
"eth_getTransactionByBlockHashAndIndex": (*ethApi).GetTransactionByBlockHashAndIndex, "eth_getTransactionByBlockHashAndIndex": (*ethApi).GetTransactionByBlockHashAndIndex,
"eth_getUncleByBlockHashAndIndex": (*ethApi).GetUncleByBlockHashAndIndex, "eth_getUncleByBlockHashAndIndex": (*ethApi).GetUncleByBlockHashAndIndex,
"eth_getUncleByBlockNumberAndIndex": (*ethApi).GetUncleByBlockNumberAndIndex, "eth_getUncleByBlockNumberAndIndex": (*ethApi).GetUncleByBlockNumberAndIndex,
@ -115,7 +116,8 @@ func (self *ethApi) Hashrate(req *shared.Request) (interface{}, error) {
} }
func (self *ethApi) BlockNumber(req *shared.Request) (interface{}, error) { func (self *ethApi) BlockNumber(req *shared.Request) (interface{}, error) {
return self.xeth.CurrentBlock().Number(), nil num := self.xeth.CurrentBlock().Number()
return newHexNum(num.Bytes()), nil
} }
func (self *ethApi) GetBalance(req *shared.Request) (interface{}, error) { func (self *ethApi) GetBalance(req *shared.Request) (interface{}, error) {