aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-06 11:37:45 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-06 11:37:45 +0800
commitef9d825cfaa274a4063bf7dcbf19c033e29b90aa (patch)
treef7bf3e516ed238b5f70fafc07a77eb21ea616f60 /xeth
parent9f5e9eb38d7bf00ec24ce4ae09f910236f776641 (diff)
downloadgo-tangerine-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar
go-tangerine-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar.gz
go-tangerine-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar.bz2
go-tangerine-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar.lz
go-tangerine-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar.xz
go-tangerine-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar.zst
go-tangerine-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.zip
Refactor & cleanup
Diffstat (limited to 'xeth')
-rw-r--r--xeth/xeth.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 8dd905b86..451d3ceea 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -86,21 +86,17 @@ func (self *XEth) BlockByHash(strHash string) *Block {
return NewBlock(block)
}
-func (self *XEth) BlockByNumber(num int32) *Block {
- if num == -1 {
- return NewBlock(self.chainManager.CurrentBlock())
- }
-
- return NewBlock(self.chainManager.GetBlockByNumber(uint64(num)))
+func (self *XEth) BlockByNumber(num uint64) *Block {
+ return NewBlock(self.chainManager.GetBlockByNumber(num))
}
func (self *XEth) Block(v interface{}) *Block {
if n, ok := v.(int32); ok {
- return self.BlockByNumber(n)
+ return self.BlockByNumber(uint64(n))
} else if str, ok := v.(string); ok {
return self.BlockByHash(str)
} else if f, ok := v.(float64); ok { // Don't ask ...
- return self.BlockByNumber(int32(f))
+ return self.BlockByNumber(uint64(f))
}
return nil