aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
Diffstat (limited to 'xeth/xeth.go')
-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))