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

@ -155,7 +155,6 @@ func TestAppCalls(t *testing.T) {
}
// make sure we can lookup the tx with proof
// ptx, err := c.Tx(bres.Hash, true)
ptx, err := c.Tx(bres.Hash, true)
require.Nil(err, "%d: %+v", i, err)
assert.EqualValues(txh, ptx.Height)
@ -168,6 +167,15 @@ func TestAppCalls(t *testing.T) {
assert.True(len(appHash) > 0)
assert.EqualValues(apph, block.BlockMeta.Header.Height)
// now check the results
blockResults, err := c.BlockResults(&apph)
require.Nil(err, "%d: %+v", i, err)
assert.Equal(apph, blockResults.Height)
if assert.Equal(1, len(blockResults.Results)) {
// check success code
assert.EqualValues(0, blockResults.Results[0].Code)
}
// check blockchain info, now that we know there is info
// TODO: is this commented somewhere that they are returned
// in order of descending height???