aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-11 01:52:45 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-11 01:52:45 +0800
commit3d6519e45bbd689b75c3ad6966c2044f29c649df (patch)
tree7bb30324d9002b3a6ea1fb7777b62e23a03a25c4 /xeth
parent617804c32731c5103319e7072557f62a9ce63836 (diff)
downloaddexon-3d6519e45bbd689b75c3ad6966c2044f29c649df.tar.gz
dexon-3d6519e45bbd689b75c3ad6966c2044f29c649df.tar.zst
dexon-3d6519e45bbd689b75c3ad6966c2044f29c649df.zip
Update response types
Diffstat (limited to 'xeth')
-rw-r--r--xeth/xeth.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index c0281f1da..67bb3c622 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -99,6 +99,13 @@ func (self *XEth) BlockByHash(strHash string) *Block {
return NewBlock(block)
}
+func (self *XEth) EthBlockByHash(strHash string) *types.Block {
+ hash := fromHex(strHash)
+ block := self.chainManager.GetBlock(hash)
+
+ return block
+}
+
func (self *XEth) BlockByNumber(num int64) *Block {
if num == -1 {
return NewBlock(self.chainManager.CurrentBlock())
@@ -107,6 +114,14 @@ func (self *XEth) BlockByNumber(num int64) *Block {
return NewBlock(self.chainManager.GetBlockByNumber(uint64(num)))
}
+func (self *XEth) EthBlockByNumber(num int64) *types.Block {
+ if num == -1 {
+ return self.chainManager.CurrentBlock()
+ }
+
+ return self.chainManager.GetBlockByNumber(uint64(num))
+}
+
func (self *XEth) Block(v interface{}) *Block {
if n, ok := v.(int32); ok {
return self.BlockByNumber(int64(n))