Add /block_results?height=H as rpc endpoint

Expose it in rpc client
Move ABCIResults into tendermint/types from tendermint/state
This commit is contained in:
Ethan Frey
2017-12-22 17:59:52 +01:00
committed by Ethan Buchman
parent 58c5df729b
commit d65234ed51
11 changed files with 217 additions and 110 deletions

View File

@@ -152,6 +152,15 @@ func (c *HTTP) Block(height *int64) (*ctypes.ResultBlock, error) {
return result, nil
}
func (c *HTTP) BlockResults(height *int64) (*ctypes.ResultBlockResults, error) {
result := new(ctypes.ResultBlockResults)
_, err := c.rpc.Call("block_results", map[string]interface{}{"height": height}, result)
if err != nil {
return nil, errors.Wrap(err, "Block Result")
}
return result, nil
}
func (c *HTTP) Commit(height *int64) (*ctypes.ResultCommit, error) {
result := new(ctypes.ResultCommit)
_, err := c.rpc.Call("commit", map[string]interface{}{"height": height}, result)