forked from cerc-io/plugeth
Added block by number
This commit is contained in:
parent
55a2f35a64
commit
89c442cadb
@ -28,6 +28,14 @@ func (self *JSPipe) BlockByHash(strHash string) *JSBlock {
|
||||
return NewJSBlock(block)
|
||||
}
|
||||
|
||||
func (self *JSPipe) GetBlockByNumber(num int32) *JSBlock {
|
||||
if num == -1 {
|
||||
return NewJSBlock(self.obj.BlockChain().CurrentBlock)
|
||||
}
|
||||
|
||||
return NewJSBlock(self.obj.BlockChain().GetBlockByNumber(uint64(num)))
|
||||
}
|
||||
|
||||
func (self *JSPipe) Key() *JSKey {
|
||||
return NewJSKey(self.obj.KeyManager().KeyPair())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user