aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/api.go6
-rw-r--r--rpc/args.go8
-rw-r--r--rpc/args_test.go4
-rw-r--r--xeth/xeth.go7
4 files changed, 11 insertions, 14 deletions
diff --git a/rpc/api.go b/rpc/api.go
index ad48b8607..4ae0ff668 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -212,7 +212,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
args := new(HashIndexArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
}
- tx := api.xeth().EthTransactionByHash(args.Hash.Hex())
+ tx := api.xeth().EthTransactionByHash(args.Hash)
if tx != nil {
*reply = NewTransactionRes(tx)
}
@@ -257,7 +257,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
uhash := br.Uncles[args.Index].Hex()
- uncle := NewBlockRes(api.xeth().EthBlockByHexstring(uhash))
+ uncle := NewBlockRes(api.xeth().EthBlockByHash(uhash))
*reply = uncle
case "eth_getUncleByBlockNumberAndIndex":
@@ -275,7 +275,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
uhash := v.Uncles[args.Index].Hex()
- uncle := NewBlockRes(api.xeth().EthBlockByHexstring(uhash))
+ uncle := NewBlockRes(api.xeth().EthBlockByHash(uhash))
*reply = uncle
case "eth_getCompilers":
diff --git a/rpc/args.go b/rpc/args.go
index 3637aff66..19258263c 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -61,7 +61,7 @@ func numString(raw interface{}, number *int64) error {
}
type GetBlockByHashArgs struct {
- BlockHash common.Hash
+ BlockHash string
IncludeTxs bool
}
@@ -80,7 +80,7 @@ func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) {
if !ok {
return NewInvalidTypeError("blockHash", "not a string")
}
- args.BlockHash = common.HexToHash(argstr)
+ args.BlockHash = argstr
if len(obj) > 1 {
args.IncludeTxs = obj[1].(bool)
@@ -360,7 +360,7 @@ func (args *BlockNumIndexArgs) UnmarshalJSON(b []byte) (err error) {
}
type HashIndexArgs struct {
- Hash common.Hash
+ Hash string
Index int64
}
@@ -379,7 +379,7 @@ func (args *HashIndexArgs) UnmarshalJSON(b []byte) (err error) {
if !ok {
return NewInvalidTypeError("hash", "not a string")
}
- args.Hash = common.HexToHash(arg0)
+ args.Hash = arg0
if len(obj) > 1 {
arg1, ok := obj[1].(string)
diff --git a/rpc/args_test.go b/rpc/args_test.go
index da98071e9..71f1a7058 100644
--- a/rpc/args_test.go
+++ b/rpc/args_test.go
@@ -191,7 +191,7 @@ func TestGetBalanceArgsAddressInvalid(t *testing.T) {
func TestGetBlockByHashArgs(t *testing.T) {
input := `["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true]`
expected := new(GetBlockByHashArgs)
- expected.BlockHash = common.HexToHash("0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331")
+ expected.BlockHash = "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
expected.IncludeTxs = true
args := new(GetBlockByHashArgs)
@@ -1444,7 +1444,7 @@ func TestBlockNumIndexArgsIndexInvalid(t *testing.T) {
func TestHashIndexArgs(t *testing.T) {
input := `["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x1"]`
expected := new(HashIndexArgs)
- expected.Hash = common.HexToHash("0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b")
+ expected.Hash = "0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b"
expected.Index = 1
args := new(HashIndexArgs)
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 92e73c7d5..bf30fc2fc 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -160,16 +160,13 @@ func (self *XEth) BlockByHash(strHash string) *Block {
return NewBlock(block)
}
-func (self *XEth) EthBlockByHash(hash common.Hash) *types.Block {
+func (self *XEth) EthBlockByHash(strHash string) *types.Block {
+ hash := common.HexToHash(strHash)
block := self.backend.ChainManager().GetBlock(hash)
return block
}
-func (self *XEth) EthBlockByHexstring(strHash string) *types.Block {
- return self.EthBlockByHash(common.HexToHash(strHash))
-}
-
func (self *XEth) EthTransactionByHash(hash string) *types.Transaction {
data, _ := self.backend.ExtraDb().Get(common.FromHex(hash))
if len(data) != 0 {
3598dff5333dc475299ba54039'>In preparation for making libtool generate libraries with a sane name, fix allbapt2013-12-111-2/+2 * Update to libmpc version 1.0.1 which brings the following fixes:gerald2013-10-261-1/+1 * Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-211-0/+1 * - Update *_DEPENDS on x11-toolkits/py-tkinter after _tkinter.so relocationlwhsu2013-03-031-6/+3 * Dependency line should not end with a '/'bapt2012-10-111-1/+1 * - unbreak builddb2012-02-104-30/+27 * Remove more tags from pkg-descr files fo the form:dougb2011-10-241-2/+0 * - Mark BROKEN: does not build with new fortranpav2011-10-191-0/+2 * - update fftw3* to 3.3 [1], and adjust dependent portsbf2011-10-171-1/+1 * - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-241-2/+2 * - Get Rid MD5 supportmiwi2011-03-201-1/+0 * - Move over to python2.5 or highermiwi2011-02-251-2/+2 * Sync to new bsd.autotools.mkade2010-12-041-1/+1 * - update to jpeg-8dinoex2010-02-051-1/+1 * - Temporary hack to fix the build for now.db2009-10-061-0/+2 * Bump PORTREVISION for everything that sets USE_FORTRAN=yes which nowgerald2009-09-131-0/+1 * - Embarassingly forgot to add Makefile.svn_revdb2009-09-021-0/+1 * - Upgrade to wsjt 7.04db2009-09-024-52/+82 * -Repocopy devel/libtool15 -> libtool22 and libltdl15 -> libltdl22.mezz2009-08-031-1/+1 * - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-31