diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-11 01:52:45 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-11 01:52:45 +0800 |
commit | 3d6519e45bbd689b75c3ad6966c2044f29c649df (patch) | |
tree | 7bb30324d9002b3a6ea1fb7777b62e23a03a25c4 /xeth | |
parent | 617804c32731c5103319e7072557f62a9ce63836 (diff) | |
download | go-tangerine-3d6519e45bbd689b75c3ad6966c2044f29c649df.tar.gz go-tangerine-3d6519e45bbd689b75c3ad6966c2044f29c649df.tar.zst go-tangerine-3d6519e45bbd689b75c3ad6966c2044f29c649df.zip |
Update response types
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/xeth.go | 15 |
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)) |